A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/323648.html below:

Metaclasses, decorators, and synchronization

Metaclasses, decorators, and synchronizationMichael Ekstrand mekstran at scl.ameslab.gov
Mon Sep 26 17:58:16 EDT 2005
On Sep 26, 2005, at 4:21 PM, Scott David Daniels wrote:
> Unnecessarily holding a lock while acquiring another can be a nasty
> source of deadlock or at least delay.  Another source of problems is
> holding a lock because an exception skipped past the release code.

I had thought of part of that after I sent my email. Didn't think of 
the exception issue or the specific deadlock scenario though.  Thank 
you much for your help/advice.

One issue remains in this function: my method's signature is lost when 
synchronized is applied (at least as somemeth=synchronized(somemeth); 
I'm currently in a 2.3 environment that doesn't have the decorator 
syntax, but my understanding is that makes no difference). I've been 
able to preserve the doc string by setting the __doc__ attribute of the 
inner function before returning it, but is there a way to make this 
inner function appear to bear the same argument list as the original 
method? I've been poking around in new and inspect, but it is not 
appearing like an easy task.

Thanks,
- Michael


More information about the Python-list mailing list

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