Message181077
| Author |
ronaldoussoren |
| Recipients |
ronaldoussoren |
| Date |
2013年02月01日.12:04:09 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1359720249.45.0.636002912798.issue17053@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年02月01日 12:04:09 | ronaldoussoren | set | recipients:
+ ronaldoussoren |
| 2013年02月01日 12:04:09 | ronaldoussoren | set | messageid: <1359720249.45.0.636002912798.issue17053@psf.upfronthosting.co.za> |
| 2013年02月01日 12:04:09 | ronaldoussoren | link | issue17053 messages |
| 2013年02月01日 12:04:09 | ronaldoussoren | create |
|