Terry J. Reedy added the comment:

.signature also handles wrapped functions better.

>>> def deco(f):
        import functools
        @functools.wraps(f)
        def ret(*args, **kw):
                return f(*args, **kw)
        return ret

>>> @deco
def f(n, k):
        return n + k*2

>>> import inspect as ip
>>> isf=ip.signature(f)
>>> print(isf)
(n, k)
>>> ip.formatargspec(*ip.getfullargspec(f))
'(*args, **kw)'

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19903>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to