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/310223.html below:

Metaclasses, decorators, and synchronization

Metaclasses, decorators, and synchronizationMichele Simionato michele.simionato at gmail.com
Tue Sep 27 01:22:56 EDT 2005
Michael Ekstrand ha scritto:
> 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.

It is not that easy, but you can leverage on my decorator module
which does exactly what you want:
http://www.phyast.pitt.edu/~micheles/python/decorator.zip

 Michele Simionato


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