The Python Way

Joel Bender jjb5 at cornell.edu
Wed Mar 27 14:32:03 EST 2002


> In any large application, it gets *tiresome* to see this, particularly
> if you add another layer of nested try/except.

Thinking of automatic locking concepts, has there been a PEP for 
synchronized objects like Java?

    class Snorf:
        def __init__(self):
            self.lock = lock.lock()

        def doSomething(self,x) synchronize(self.lock):
            code

It would be nice if the synchronize parameter could be an instance, 
class or module lock.


Joel



More information about the Python-list mailing list