I just was hunting a Heisenbug related to Python3. It boils down to the
following:

dakrenn@nops:~$ /opt/sage/8.5.beta2-python3/sage -c "P.<x,y,z> = QQ[]; S
= Set([x,y,z]).subsets(2); print(S); print(list(S))"
Subsets of {y, x, z} of size 2
[{x, y}, {z, y}, {z, x}]
dakrenn@nops:~$ /opt/sage/8.5.beta2-python3/sage -c "P.<x,y,z> = QQ[]; S
= Set([x,y,z]).subsets(2); print(S); print(list(S))"
Subsets of {z, x, y} of size 2
[{z, x}, {z, y}, {x, y}]
dakrenn@nops:~$ /opt/sage/8.5.beta2-python3/sage -c "P.<x,y,z> = QQ[]; S
= Set([x,y,z]).subsets(2); print(S); print(list(S))"
Subsets of {y, x, z} of size 2
[{y, x}, {y, z}, {x, z}]

So the order in which the subsets appear is random (and also the order
in the sets). I was wondering why this order is *now* (Python3) random,
but was not before:

dakrenn@nops:~$ sage -c "P.<x,y,z> = QQ[]; S = Set([x,y,z]).subsets(2);
print(S); print(list(S))"
Subsets of {y, z, x} of size 2
[{y, z}, {y, x}, {z, x}]

The result in Python2-SageMath was the same for roughly 10 runs (for
Python3 above, three runs three different results).

(My question is also because there is an order on the elements
themselves, namely z < y < x. And I am aware that sets are unordered so
ordering is not to be expected, but still there is this change and I was
wondering why (as the elements themselves are still comparable in
Python3-SageMath.)

Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to