Greg Ewing wrote: > > "M.-A. Lemburg" <mal@lemburg.com>: > > > The problem is that with nested scoping, a function defined > > within another function will suddenly reference the variables > > of the enclosing function > > This could be avoided by requiring that variables which are > to be visible in an inner scope be marked somehow in the > scope where they are defined. > > I don't think it's a serious enough problem to be worth > fixing that way, though. It may not look serious, but changing the Python lookup scheme is, since many inspection tools rely and reimplement exactly that scheme. With nested scopes, there would be next to no way to emulate the lookups using these tools. To be honest, I don't think static nested scopes buy us all that much. You can do the same now, by using keyword arguments which isn't all that nice, but works great and makes the scope clearly visible. Dynamic nested scopes is another topic... those are *very* useful; especially when it comes to avoiding global variables and implementing programs which work using control objects instead of global function calls. -- Marc-Andre Lemburg ______________________________________________________________________ Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
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