Skip to content

Commit 43b3519

Browse files
committed
Arguments
1 parent 96d9767 commit 43b3519

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,8 @@ def f(<nondefault_args>): # def f(x, y):
679679
def f(<default_args>): # def f(x=0, y=0):
680680
def f(<nondefault_args>, <default_args>): # def f(x, y=0):
681681
```
682-
* **Value of a default argument is evaluated when function is first encountered in the scope.**
683-
* **If this value is a mutable object, then all its mutations will persist between invocations.**
682+
* **Default values are evaluated when function is first encountered in the scope.**
683+
* **Any mutations of mutable default values will persist between invocations.**
684684

685685

686686
Splat Operator

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,8 @@
601601
</code></pre></div>
602602

603603
<ul>
604-
<li><strong>Value of a default argument is evaluated when function is first encountered in the scope.</strong></li>
605-
<li><strong>If this value is a mutable object, then all its mutations will persist between invocations.</strong></li>
604+
<li><strong>Default values are evaluated when function is first encountered in the scope.</strong></li>
605+
<li><strong>Any mutations of mutable default values will persist between invocations.</strong></li>
606606
</ul>
607607
<div><h2 id="splatoperator"><a href="#splatoperator" name="splatoperator">#</a>Splat Operator</h2><div><h3 id="insidefunctioncall-1">Inside Function Call</h3><p><strong>Splat expands a collection into positional arguments, while splatty-splat expands a dictionary into keyword arguments.</strong></p><pre><code class="python language-python hljs">args = (<span class="hljs-number">1</span>, <span class="hljs-number">2</span>)
608608
kwargs = {<span class="hljs-string">'x'</span>: <span class="hljs-number">3</span>, <span class="hljs-string">'y'</span>: <span class="hljs-number">4</span>, <span class="hljs-string">'z'</span>: <span class="hljs-number">5</span>}

0 commit comments

Comments
 (0)