At 11:01 AM 11/16/04 -0500, Michael Walter wrote: >Hello everyone, > >I was just wondering about the status of PEP 310 ("with" statement) - >has there been any concensus/plan to implement it? (I tried to google >the answer, but failed ;-) Guido has previously said that "with" is reserved for a use similar to the use of the "with" statement in Turbo Pascal and Visual Basic; that is, a shortcut for referring to a long expression. Whether that means PEP 310 needs a new keyword, or that it needs to play a dual role, I'm not sure. >How about the potentiel inclusion of user-defined "blocks"? I suppose >this would be only a Python 3000 thing, if ever included? With the advent of PEP 318, it's now possible to do block-like things with closures and decorators, e.g.: @with_lock(mylock) def do_something(): # code here do_something() This is somewhat ugly, however, when used in-line. On the other hand, this could also be viewed as an encouragement to modularize more, in order to have more readable code. :)
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