This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terrence
Recipients terrence
Date 2010-05-24.21:20:56
SpamBayes Score 0.00048081376
Marked as misclassified No
Message-id <1274736059.05.0.616257463555.issue8814@psf.upfronthosting.co.za>
In-reply-to
Content
__annotations__ should be included in the set of attributes copied by default to a wrapped method.

An example of the problem:
>>> from functools import wraps
>>> def mydecorator(fn):
...     @wraps(fn)
...     def inner(*args, **kwargs):
...         return fn(*args, **kwargs)
...     return inner
...
>>> @mydecorator
... def foo(a:int, b:str):
...     pass
... 
>>> foo.__annotations__
{}

With the included fix:
>>> foo.__annotations__
{'a': <class 'int'>, 'b': <class 'str'>}
History
Date User Action Args
2010-05-24 21:20:59terrencesetrecipients: + terrence
2010-05-24 21:20:59terrencesetmessageid: <1274736059.05.0.616257463555.issue8814@psf.upfronthosting.co.za>
2010-05-24 21:20:57terrencelinkissue8814 messages
2010-05-24 21:20:57terrencecreate