[issue19903] Idle: Use inspect.signature for calltips

Terry J. Reedy report at bugs.python.org
Sun Feb 1 10:30:15 CET 2015


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 <report at bugs.python.org>
<http://bugs.python.org/issue19903>
_______________________________________


More information about the Python-bugs-list mailing list