You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
I don't think that they currently get linked automatically. I have done a little bit of testing, and this sort of thing seems to work to generate links to MyClass and MyOtherClass docs:
my_param : float or :class:`MyClass` or :class:`MyOtherClass`
It would be nice if they could be auto-detected, though. I wonder if actually we could just try to auto-link them all with :class: and see what happens.
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?
datetime.date
or :class:datetime.datetime
~datetime.date
or :class:~datetime.datetime
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).
The text was updated successfully, but these errors were encountered: