Skip to content

Commit

Permalink
document default values as part of the type spec (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis authored Jan 9, 2021
1 parent 2e76685 commit af154f4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ The sections of a function's docstring are:
Description of parameter `x` (the default is -1, which implies summation
over all axes).

or as part of the type, instead of ``optional``. If the default value would not be
used as a value, ``optional`` is preferred. These are all equivalent::

copy : bool, default True
copy : bool, default=True
copy : bool, default: True

When a parameter can only assume one of a fixed set of values,
those values can be listed in braces, with the default appearing first::

Expand Down

0 comments on commit af154f4

Please sign in to comment.