Moshe Zadka writes: > On Wed, 26 Jul 2000, Guido van Rossum wrote: > > > > OK, how's that: inner functions have weak reference to variables in the > > > same scope > > > > > > def f(): > > > x = 1 > > > def g(): > > > pass > > > > Insert "print x" in the body of g, and "return g" in the body of f. > > What are you trying to do, simulate classes via closures? I don't see any > reason for this to work. > There's not simulation going on. He's just expecting closures to work. I think that any proposal for changed scoping needs to do lexical scoping properly, including closures. If it doesn't, I vote -1. The argument about finalization is specious. You should not write code that depends on current finalization semantics to do things like closing files. It's relying on an implementation-dependent feature that is not part of the language spec. (Just try it on JPython.) Jeremy
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