> > BTW, you can't use locals() or globals() because you really want > > globals()-overridden-with-locals(), i.e. > > > > d = globals().copy() > > d.update(locals()) > > What about free/cell vars? Will these be used? > If not, is that a problem? Without compiler support for this construct we have no hope of getting references to outer non-global scopes right. E.g. def f(): x = 12 def g(): return "x is $x".sub() return g Here the compiler has no clue that g references x, so it wouldn't do the special treatment for x that's needed to make it work. I see no way to fix this in general without introducing new syntax; note that the string "x is $x" could have been an argument to g(). --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4