Issue #828 resolved

autodoc: python3 keyword-only arguments

1st1 avatar1st1 created an issue

New python3 function arguments syntax seems to be unsupported. The attached patch resolves the issue, and the test suit seems to be passing OK.

Patch modifies sphinx.utils.inspect.getargspec to use the new inspect.getfullagrspec function.

Besides just unwrapping functools.partial, I've also added the code to unwrap decorators. In python3, functools.wraps adds special attribute to the decorator - wrapped, which points to the function being decorated. Now, functions decorated with @contextlib.contextmanager have correct documentation with autodoc.

Comments (2)

  1. Antony Lee

    While this issue is quite old I would like to raise it again as it still hasn't been fixed. The suggested patch worked perfectly for me.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.