Variables in nested functions

Bruno Desthuilliers onurb at xiludom.gro
Wed Aug 30 04:35:16 EDT 2006


zero.maximum at gmail.com wrote:
> Is it possible to change the value of a variable in the outer function
> if you are in a nested inner function?

Depends on what you mean by "changing the value". If you mean mutating a
mutable object, yes, it's possible. If you mean rebinding the name to a
different object, no, it isn't possible actually.


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list