Skip to content

Commit b9f6ac9

Browse files
Stick with the phrase "default parameter value" (GH-21590)
1 parent 9b9f158 commit b9f6ac9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/reference/compound_stmts.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,9 @@ value --- this is a syntactic restriction that is not expressed by the grammar.
571571
**Default parameter values are evaluated from left to right when the function
572572
definition is executed.** This means that the expression is evaluated once, when
573573
the function is defined, and that the same "pre-computed" value is used for each
574-
call. This is especially important to understand when a default parameter is a
574+
call. This is especially important to understand when a default parameter value is a
575575
mutable object, such as a list or a dictionary: if the function modifies the
576-
object (e.g. by appending an item to a list), the default value is in effect
576+
object (e.g. by appending an item to a list), the default parameter value is in effect
577577
modified. This is generally not what was intended. A way around this is to use
578578
``None`` as the default, and explicitly test for it in the body of the function,
579579
e.g.::

0 commit comments

Comments
 (0)