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

Improve documentation for star parameters #9893

Open
kevinoid opened this issue Nov 26, 2021 · 1 comment
Open

Improve documentation for star parameters #9893

kevinoid opened this issue Nov 26, 2021 · 1 comment
Labels
type:enhancement enhance or introduce a new feature

Comments

@kevinoid
Copy link

Is your feature request related to a problem? Please describe.

It is not clear to me how to document a star parameter of a variadic function and whether the parameter name should be prefixed with *, \*, or nothing. This is particularly true in Sphinx style, but also applies to Google and NumPy styles to some extent (*args and **kwargs appear in an example, but it's not clear if that's the preferred or only syntax). This has caused confusion for linters, such as:

It appears that both no-prefix and backslash-star are accepted for Sphinx style, and that all three are accepted for Google and NumPy style (due to auto-escaping in sphinx.ext.napoleon as noted in peterjc/flake8-rst-docstrings#18 (comment) ). Is this correct? Are any styles preferred?

Describe the solution you'd like

I had checked for examples in both Describing code in Sphinx or The Python Domain. I'd recommend adding an example to both with the preferred style, and discussing other supported styles in The Python Domain.

Describe alternatives you've considered

Keeping the status quo is always an option. We can weigh the current ambiguity and confusion against the effort to write and maintain the docs.

Thanks for considering,
Kevin

@saroad2
Copy link

saroad2 commented Apr 7, 2022

I would love to know the answer for that question.
This ability is very important in Pylint

@AA-Turner AA-Turner added this to the some future version milestone Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement enhance or introduce a new feature
Projects
None yet
Development

No branches or pull requests

3 participants