Greg Ewing wrote: > By the way, I happen to think there are better uses > to which the word 'with' could be put, e.g. the > suggestion of making > > with lock(foo): > do_something() > > mean something like > > _x = lock(foo) > _x.__enter__() > try: > do_something() > finally: > _x.__exit() That would be nice, but here is what I would like it to mean: def _f(): do_something() lock(foo)(_f) That would allow the object of the "with" statement to execute the code block once, many times, or not at all. Shane
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