Nested scopes hitch

Greg Weeks weeks at vitus.scs.agilent.com
Fri Apr 5 14:33:43 EST 2002


Marek Augustyn (maug at poczta.onet.pl) wrote:
: Would somebody explain the following behavior (Python 2.2)?

: Function nested in class:
: (why nested scoping doesn't work?)

One way to put it is this: Python 2.2 did not create nested scopes (they've
always been there) or make nested scopes visible in function/method code.
It simply *increased* the visibility of nested scopes beyond the original
visibility of local+global.  How much is it increased?  Well, gee, I
forget.  (I guess the language is getting too big for me.)

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.


Greg



More information about the Python-list mailing list