Nick Coghlan did a +1 job to write: > 1. Amend the statement specification such that: > > with EXPR as VAR: > BLOCK > > is translated as: > > abc = (EXPR).__with__() > exc = (None, None, None) > VAR = abc.__enter__() > try: > try: > BLOCK > except: > exc = sys.exc_info() > raise > finally: > abc.__exit__(*exc) Note that __with__ and __enter__ could be combined into one with no loss of functionality: abc,VAR = (EXPR).__with__() exc = (None, None, None) try: try: BLOCK except: exc = sys.exc_info() raise finally: abc.__exit__(*exc) - Anders
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