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

DOC: use single back-ticks for variable, module, function, and class names #36006

Open
MarcoGorelli opened this issue Aug 31, 2020 · 2 comments
Open

Comments

@MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Aug 31, 2020

EDIT I've rewritten this issue after Joris' comment.


Pandas' docstrings are somewhat inconsistent in using single or double back-ticks, e.g. isin has both

`values`

and

``values``

In keeping with the numpydoc docstring guide, which reads

Use italics, bold and monospace if needed in any explanations (but not for variable names and doctest code or multi-line code). Variable, module, function, and class names should be written between single back-ticks (numpy).

, it might be good update docstrings which don't follow this convention, as well as to mention this convention in the pandas docstring guide.

@jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche commented Aug 31, 2020

In theory, this is correct (and consistent within the guide I think). It follows the numpydoc docstring guide: https://numpydoc.readthedocs.io/en/latest/format.html

But of course that doesn't mean we need to follow it (how it gets rendered also depends on your sphinx configuration).

@MarcoGorelli
Copy link
Member Author

@MarcoGorelli MarcoGorelli commented Aug 31, 2020

In theory, this is correct (and consistent within the guide I think). It follows the numpydoc docstring guide: https://numpydoc.readthedocs.io/en/latest/format.html

Thanks, I wasn't aware of that. They make it quite clear which to use:

Use italics, bold and monospace if needed in any explanations (but not for variable names and doctest code or multi-line code). Variable, module, function, and class names should be written between single back-ticks (numpy).

Pandas' docstrings seem to jump between the two, e.g. isin has both

`values`

and

``values``

So, perhaps this should be changed to encourage easy contributions to be more consistent about this in the docstrings?

@MarcoGorelli MarcoGorelli changed the title DOC: use double-backticks in examples from docstring guide DOC: use single back-ticks for variable, module, function, and class names Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.