> From: Roman Suzi [mailto:rnd@onego.ru] >=20 > What about just adding a parameter to try operator? >=20 > def increment(self): > try self.counter_lock: > self.counter +=3D 1 >=20 > - this will save from keyword and could also be used with > except part with, for example, se-syncronization outcomes > for some kinds of locks: >=20 > def increment(self): > try self.counter_lock: > self.counter +=3D 1 > except SomeLockError: > bla-bla-bla Hmm - so this is essentially the initially: self.counter_lock.acquire() try: ... finally: self.counter_lock.release() but with the condition that the "parameter" to try implement the = Lockable interface (or something along those lines). Interesting idea. Not sure about the syntax, but I think we could go = somewhere with this. Tim Delaney
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