Skip to content

convention when input can be an instance of a class #43

Open
@cmeeren

Description

@cmeeren

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions