[Python-Dev] New PEP: 319

Michel Pelletier michel@dialnetwork.com
2003年6月16日 01:51:02 -0500 (CDT)


> On 2003年6月16日, 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

AltStyle によって変換されたページ (->オリジナル) /