Nested scopes hitch

Greg Weeks weeks at vitus.scs.agilent.com
Mon Apr 8 15:43:33 EDT 2002


Jeremy Hylton (jeremy at alum.mit.edu) wrote:
: > Anyway, it increased visibility enough so that it is no longer possible to
: > call a function and pass it the scope as two dictionaries, which I had 
: > found handy on occasion.

: I'm not sure I follow the details here, but I don't see how the change
: in the scope rules would affect a function unless it specifically
: exploited nested scopes.  If you wrote a function that only uses
: locals and globals, can you not call it just the way you always did?

Yes, the function continues to work.  But the documentation changes.
Originally, calling the function with the arguments globals() and locals()
passed to the function all the variable bindings visible at the point where
the function was called.  That is a tidy concept, and I'm sorry to lose it.

Regards,
Greg



More information about the Python-list mailing list