Skip to content

Commit af154f4

Browse files
authored
document default values as part of the type spec (#289)
1 parent 2e76685 commit af154f4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/format.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,13 @@ The sections of a function's docstring are:
197197
Description of parameter `x` (the default is -1, which implies summation
198198
over all axes).
199199

200+
or as part of the type, instead of ``optional``. If the default value would not be
201+
used as a value, ``optional`` is preferred. These are all equivalent::
202+
203+
copy : bool, default True
204+
copy : bool, default=True
205+
copy : bool, default: True
206+
200207
When a parameter can only assume one of a fixed set of values,
201208
those values can be listed in braces, with the default appearing first::
202209

0 commit comments

Comments
 (0)