##// END OF EJS Templates
Use the more powerful signatures module to display function argument signatures. In particular this works better for functions wrapped with functools.wraps (at least on Python >= 3.4)
Erik M. Bray -
Show More
@@ -40,6 +40,7 from IPython.utils.text import indent
40 40 from IPython.utils.wildcard import list_namespace
41 41 from IPython.utils.coloransi import TermColors, ColorScheme, ColorSchemeTable
42 42 from IPython.utils.py3compat import cast_unicode, string_types, PY3
43 from IPython.utils.signatures import signature
43 44
44 45 # builtin docstrings to ignore
45 46 _func_call_docstring = types.FunctionType.__call__.__doc__
@@ -390,7 +391,7 class Inspector:
390 391 If any exception is generated, None is returned instead and the
391 392 exception is suppressed."""
392 393 try:
393 hdef = oname + inspect.formatargspec(*getargspec(obj))
394 hdef = oname + str(signature(obj))
394 395 return cast_unicode(hdef)
395 396 except:
396 397 return None
General Comments 0
You need to be logged in to leave comments. Login now