New submission from Terrence Cole <terre...@zettabytestorage.com>: __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'>} ---------- components: Library (Lib) files: functools-wrapper-assign-annotations.diff keywords: patch messages: 106394 nosy: terrence priority: normal severity: normal status: open title: functools.WRAPPER_ASSIGNMENTS should include __annotations__ type: behavior versions: Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file17453/functools-wrapper-assign-annotations.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8814> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com