Hi, look at the following simple routine.
def why():
test=((k2,k1) for k1 in xrange(2,4) for k2 in xrange(1,k1) if
gcd(k1,k2)==1)
print [t for t in test]
print [t for t in test]
return
why()
[(1, 2), (1, 3), (2, 3)]
[]
It seems that "test" can only be used once.
The Python documentation does not indicate a loss of a 'generator'
once used.
Question: Python or Sage behavior?
Roland
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org