Skip to content

numpydoc convention when input can be an instance of a class #6709

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

Closed
cmeeren opened this issue Nov 20, 2015 · 1 comment
Closed

numpydoc convention when input can be an instance of a class #6709

cmeeren opened this issue Nov 20, 2015 · 1 comment

Comments

@cmeeren
Copy link

cmeeren commented Nov 20, 2015

For numpydoc: What is the convention for parameter type if a parameter is an instance of specific class, e.g. datetime.datetime?

Specifically, I have a parameter which can be either a float, datetime.date, or datetime.datetime. How should I write this in the parameter section?

  • my_param : float or date or datetime
  • my_param : float or datetime.date or datetime.datetime
  • my_param : float or :class:datetime.date or :class:datetime.datetime
  • my_param : float or :class:~datetime.date or :class:~datetime.datetime
  • something else?

And of course, maybe a comma instead of the first "or", but that's nitpicking (which I like by the way) and not too important in this context (unless I'm mistaken).

@cmeeren cmeeren changed the title Convention when input can be an instance of a class numpydoc convention when input can be an instance of a class Nov 20, 2015
@cmeeren
Copy link
Author

cmeeren commented Nov 20, 2015

Sorry, I don't know how this ended up in the numpy repo, I was sure I was viewing the numpydoc repo. Posted to numpy/numpydoc#43

@cmeeren cmeeren closed this as completed Nov 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant