##// 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 b' from IPython.utils.text import indent'
40 from IPython.utils.wildcard import list_namespace
40 from IPython.utils.wildcard import list_namespace
41 from IPython.utils.coloransi import TermColors, ColorScheme, ColorSchemeTable
41 from IPython.utils.coloransi import TermColors, ColorScheme, ColorSchemeTable
42 from IPython.utils.py3compat import cast_unicode, string_types, PY3
42 from IPython.utils.py3compat import cast_unicode, string_types, PY3
43 from IPython.utils.signatures import signature
43
44
44 # builtin docstrings to ignore
45 # builtin docstrings to ignore
45 _func_call_docstring = types.FunctionType.__call__.__doc__
46 _func_call_docstring = types.FunctionType.__call__.__doc__
@@ -390,7 +391,7 b' class Inspector:'
390 If any exception is generated, None is returned instead and the
391 If any exception is generated, None is returned instead and the
391 exception is suppressed."""
392 exception is suppressed."""
392 try:
393 try:
393 hdef = oname + inspect.formatargspec(*getargspec(obj))
394 hdef = oname + str(signature(obj))
394 return cast_unicode(hdef)
395 return cast_unicode(hdef)
395 except:
396 except:
396 return None
397 return None
General Comments 0
You need to be logged in to leave comments. Login now