> On Mon, 16 Jun 2003, Michel Pelletier wrote: > >> def __init__(self): >> self.counter = 0 >> >> def increment(self): >> synchronize: >> self.counter += 1 > > What about just adding a parameter to try operator? > > def increment(self): > try self.counter_lock: > self.counter += 1 Because I would like to remove the user-visible lock entirely. Although your idea is similar to PEP 310, which proposes a new keyword "with". I think using the try keyword for this is inapropriate. -Michel
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