[Python-Dev] PEP 343 - Abstract Block Redux

Anders J. Munch andersjm at inbound.dk
Sun May 15 13:42:00 CEST 2005


Shane Hathaway wrote:
> Guido van Rossum wrote:
> >
> > Consider an application where you have to acquire *two* locks regularly:
> >
> You really have to write it like this:

Shane, you've already solved this one more elegantly:

def lockBoth():
    return combining(lock1.locking(), lock2.locking())

using the combining function you wrote earlier, which I assume will
make it into the library.

- Anders



More information about the Python-Dev mailing list