geremy condra wrote:
I decided to play around with nonlocal declarations today, and was
somewhat surprised when a call to nonlocals() resulted in 'nonlocals
is not defined'. Is there an a standard equivalent to globals() or
locals() for variables in outer nested scopes?

Geremy Condra

Not that I know of, but you can, to certain extent, do something like this:

def outer():
    def inner():
        print nonlocals
    nonlocals = locals()
    inner()
outer()
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to