Eric Sumner wrote: > I realize that I made an assumption that may not be valid; > namely, that a new scope is generated by the 'with' statement. The with statement uses the existing scope - its just a way of factoring out try/finally boilerplate code. No more, and, in fact, fractionally less (the 'less' being the fact that just like any other Python function, you only get to supply one value to be bound to a name in the invoking scope). Trying to link this with the function definition pipelining provided by decorators seems like a bit of a stretch. It certainly isn't a superset of the decorator functionality - if you want a statement that manipulates the namespace it contains, that's what class statements are for :) Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
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