I noticed that the results were not what I expected, so after exploring a little bit, it seems that the following is happening:
>>> import random
>>> l = [1,2,3,4,5]
>>> random.shuffle(l)
>>> l
[5,3,2,4,1]
>>> l
[2,4,1,3,5]
>>> l
[5,3,2,1,4]
>>> l
[3,5,2,4,1]
>>> l
[2,3,4,1,5]
It looks as though l is getting continuously shuffled in-place...
So, my questions are:
What can explain this behavior?
Is this a particular issue with my environment? I am running chrome 49.0.2623.112 on Windows Vista, which is rather old... If it is a general issue then the example in the tutorial doesn't work, unless I missed something...
Thanks!
Aaron Meurer
unread,
Mar 25, 2017, 5:07:29 PM3/25/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sy...@googlegroups.com
That's an unfortunate side effect of the way SymPy Live is currently
implemented. It reevaluates expressions every time it executes. In a
real Python shell this would work as expected.