Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Responding to updated issue: To some extent this is a Python issue, even for lists. v = int(22); L= [v]; L; v= int(23); L gives 22 both times. v.set() works because you didn't actually change the reference the variable v has, if I understand correctly.

The following does what you want, and isn't quite the loop you mentioned, though it's close. I don't know if there is a way to avoid the Python thing (feature, really) above.

sage: for x in w.iteritems(): v.set(*x)