Tommy Nordgren <[EMAIL PROTECTED]> writes: > Given the following: > def outer(arg) > avar = '' > def inner1(arg2) > # How can I set 'avar' here ?
I don't think you can, until Python 3: http://www.python.org/dev/peps/pep-3104/ Currently the (ugly) solution is to change variable assignment to object mutation: def outer(arg) avar = [''] # use avar[0] where you'd normally use avar def inner1(arg2) # modify the value of avar by setting avar[0] -- http://mail.python.org/mailman/listinfo/python-list