Message106394
__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'>} |
|
Date |
User |
Action |
Args |
2010-05-24 21:20:59 | terrence | set | recipients:
+ terrence |
2010-05-24 21:20:59 | terrence | set | messageid: <1274736059.05.0.616257463555.issue8814@psf.upfronthosting.co.za> |
2010-05-24 21:20:57 | terrence | link | issue8814 messages |
2010-05-24 21:20:57 | terrence | create | |
|