There seems to be some consistency in that calling set() on a string always seems to resolve the same (non-abelian) order, and both
set([1,2,3]) & set([1,2,3,4])
and his mixed cousin
set([2,3,1]) & set([4,3,1,2])
will result in an ordered set([1,2,3]) .
On the other hand, something like a little brighter, for example
from random import randint set([randint(0,9) for x in range(3)])
sometimes it gives something like set([9, 6, 7]) ...
... what's going on here?
source share