A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-June/080243.html below:

[Python-Dev] update_wrapper should preserve staticmethod behavior

[Python-Dev] update_wrapper should preserve staticmethod behaviorAntoine Pitrou solipsis at pitrou.net
Wed Jun 11 19:48:54 CEST 2008
Calvin Spealman <ironfroggy <at> socialserve.com> writes:
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
>    File "<stdin>", line 3, in A
>    File "<stdin>", line 5, in d
>    File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/functools.py", line 33, in update_wrapper
>      setattr(wrapper, attr, getattr(wrapped, attr))
> AttributeError: 'staticmethod' object has no attribute '__module__'

Well, if staticmethod doesn't mirror the original function's __module__
attribute, I'd say staticmethod is the culprit.

Since Python grew the update_wrapper function, it seems reasonable to ask
that all decorators (or decorator-alikes) provided with Python call
update_wrapper. Of course staticmethod is written in C, so is there a
C function somewhere providing the same functionality as update_wrapper does?



More information about the Python-Dev 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