> Btw, if __exit__ is the only spelling then: > > var = expr > > if hasattr(var, "__enter__"): > var.__enter__() > > try: > suite > > finally: > var.__exit__() > > is maybe a better semantics. If someone uses some of his legacy > file-like objects etc, but forgets to define at least __exit__, he > gets a fail-fast behavior, otherwise he may have to track down data > corruption or something like that... Good idea! --Guido van Rossum (home page: http://www.python.org/~guido/)
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