Re:Just why did people start using Python anyway?
by silentbicycle on Thursday October 09, 2008 @01:03PM
(#328017)
Interesting. So keeping a reference to a list with the value works, but the value directly doesn't? Thanks for the note.
Good to know it's possible, though I'd rather it handle closures / lexical scoping directly.
def makeAdder2(x):
works just fine in all pythons with closures (2.0 and above?)def makeAdder2(x):
Also works and provides a mechanism for resetting the state.