[issue17053] pydoc should use inspect.signature instead of inspect.getfullargspec

Ronald Oussoren report at bugs.python.org
Fri Feb 1 13:04:09 CET 2013


Ronald Oussoren added the comment:

The attached patch is a very rough prototype which seems to work (but wasn't tested beyond running pydoc on a number of function(-like) objects.

With the patch the documentation for a callable defined in C but with a __signature__ property shows argument names in the rendered prototype instead of just '(...)' while the documentation for python functions and C functions without a __signature__ also works.

Issues:

* Rendering to HTML is broken if a function has POSITIONAL_ONLY arguments
  (the names of those arguments are rendered as '<arg>' and that value
  is not escaped in the HTML output)

* This adds a "render" method to inspect.Signature and inspect.Param
  to be able to pass custom render function for elements of a signature
  and I'm not convinced that this is the right solution.

* There are no unittests for the new code (and I haven't run the existing
  tests to check if anything else has broken)

----------
stage: needs patch -> test needed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17053>
_______________________________________


More information about the Python-bugs-list mailing list