Guido van Rossum wrote: > PEP 340 redux > ============= > > Syntax: > do EXPR [as VAR]: > BLOCK > > Translation: > abc = EXPR > [VAR =] abc.__enter__() > try: > BLOCK > finally: > abc.__exit__(*"sys.exc_info()") # Not exactly > > Pros: > - can use a decorated generator as EXPR > - separation of EXPR and VAR (VAR gets what EXPR.__enter__() returns) > > Cons: > - slightly less simple (__enter__ must return something for VAR; > __exit__ takes optional args) what happened to the original "yield the target object" solution? or did I just dream that? </F>
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