This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2008年07月20日 23:08 by pv, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| autodoc-process-signature.patch | pv, 2008年07月24日 21:11 | Add autodoc-process-signature signal to sphinx.ext.autodoc | ||
| Messages (4) | |||
|---|---|---|---|
| msg70096 - (view) | Author: Pauli Virtanen (pv) * | Date: 2008年07月20日 23:08 | |
It would be useful if the autodoc-process-docstring event from sphinx.ext.autodoc allowed to change the argspec of the function being documented. Some other hook for changing the function signature would also do. We are using Sphinx for generating a reference guide for Numpy, where many of the functions are from extension modules for which inspect.getargspec does not work. Instead, the function signature is contained within the object's docstring. Right now I'm simply monkeypatching sphinx.ext.autodoc.format_signature, but a cleaner approach would be better. It seems that this would be fairly easy to implement in generate_rst. Perhaps a .signature attribute to the Options passed to the hook would be an acceptable solution? I can write a patch doing this, if someone doesn't do this faster. |
|||
| msg70226 - (view) | Author: Pauli Virtanen (pv) * | Date: 2008年07月24日 21:11 | |
Suggested patch attached. Tested on Numpy documentation. It adds a new signal, autodoc-process-signature(app, what, name, obj, options, signature, return_annotation) which is assumed to return either None or a new (signature, return_annotation) tuple. Warnings are raised only if introspection fails and none of the event handlers returns a new signature. |
|||
| msg70408 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2008年07月29日 18:31 | |
Thanks, committed the patch with a few changes in r65290. Let me know if it works! |
|||
| msg70410 - (view) | Author: Pauli Virtanen (pv) * | Date: 2008年07月29日 18:53 | |
Thanks, works OK. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:36 | admin | set | github: 47672 |
| 2008年07月29日 18:53:43 | pv | set | messages: + msg70410 |
| 2008年07月29日 18:31:02 | georg.brandl | set | status: open -> closed resolution: accepted messages: + msg70408 |
| 2008年07月24日 21:11:08 | pv | set | files:
+ autodoc-process-signature.patch keywords: + patch messages: + msg70226 |
| 2008年07月20日 23:08:34 | pv | create | |