On Wed, 2 Nov 2016, Johan S. H. Rosenkilde wrote:
for S in Subsets(GF(13).list(), 5):
if sum(S) == 1:
print "Monkey"
This code works as expected and prints monkeys galore when evaluating it
in a Sage shell. Now restart Sage and call the following line before
calling the above snippet:
a = list(Subsets(range(13), 5))
And suddenly the first code snippet will never print anything.
Tell me that's not a bug!
To me it seems to be worst than a bug: intentionally broken design.
Something like this is almost impossible to teach in classroom.
--
Jori Mäntysalo