File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
572572definition is executed. ** This means that the expression is evaluated once, when
573573the 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
575575mutable 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
577577modified. 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,
579579e.g.::
You can’t perform that action at this time.
0 commit comments