python set type not sorted
<p>I have a very odd issue when trying to sort my permutations.</p>

<p>As I have seen before on SO, using a set to sort and distinct a list is the way to go, but for one particular list, this seems not to work. We can take this for example</p>

<pre><code>&gt;&gt;&gt; set([2,1])
{1, 2}
&gt;&gt;&gt; set([1,2,1])
{1, 2}
&gt;&gt;&gt; set([513, 135, 531, 153, 315, 351])
{513, 135, 531, 153, 315, 351}
&gt;&gt;&gt; 
</code></pre>

<p>Anyone who can give me any guidance?</p>