Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using position-only parameter syntax in __init__ prevents docstrings for attributes from being parsed #9968

Closed
bryanforbes opened this issue Dec 13, 2021 · 1 comment

Comments

@bryanforbes
Copy link

Describe the bug

I'm currently using position-only parameters in most of my functions, including __init__, however this prevents inline, before, and after doc strings from being parsed.

How to Reproduce

$ git clone https://github.com/bryanforbes/sphinx-positional-only-issue
$ cd sphinx-positional-only-issue
$ pip install -r requirements.txt
$ cd docs
$ make html
$ open _build/html/index.html

Once index.html is open, you will see that only test.WithoutPositional has the a property documented.

Expected behavior

Both classes should have the a property documented

Your project

https://github.com/bryanforbes/sphinx-positional-only-issue

Screenshots

image

OS

macOS 11.6.1

Python version

3.10

Sphinx version

4.3.1

Sphinx extensions

sphinx.ext.autodoc, sphinx.ext.napoleon

Extra tools

No response

Additional context

No response

@tk0miya
Copy link
Member

tk0miya commented Dec 18, 2021

Thank you for reporting. The posonlyargs confuses our parser. Will be fixed via #9987.

tk0miya added a commit to tk0miya/sphinx that referenced this issue Dec 18, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue Dec 19, 2021
tk0miya added a commit that referenced this issue Dec 19, 2021
Fix #9968: autodoc: ivars are not shown if __init__ has posonlyargs
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants