Skip to content

DOC/Discussion: Update docstrings guide to include guidance for edge cases #28784

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

Open
josibake opened this issue Oct 4, 2019 · 1 comment
Open
Labels

Comments

@josibake
Copy link

josibake commented Oct 4, 2019

There are a few edge cases where there is not sufficient guidance in the docstrings on how to proceed. For example, if a parameter argument takes a list of values but the list is sufficiently long, it is not clear how to properly format (see #28739).

Opening this as a placeholder to document edge cases encountered while cleaning up docstrings and agree on what the convention should be.

@josibake
Copy link
Author

josibake commented Oct 4, 2019

long list of accepted values

normally, lists of known values are documented as:

unit : {'day', 'month', 'year'}, default 'day'
    Specify unit of time.

but if the list is long (say, greater than 5), the convention should be:

unit : str, default 'day'
    Specify unit of time.

    Possible values:
        * 'day', 'month', or 'year'
        * 'hour', 'minute', 'second', or 'nanosecond'
        ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants