Skip to content

Commit f1609d1

Browse files
committed
Splat operator
1 parent decba79 commit f1609d1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -724,17 +724,17 @@ def f(x, *args, z, **kwargs): # f(x=1, y=2, z=3) | f(1, y=2, z=3) | f(1, 2, z=3
724724
```
725725

726726
### Other Uses
727-
```python
728-
head, *body, tail = <collection>
729-
```
730-
731727
```python
732728
<list> = [*<collection> [, ...]]
733729
<set> = {*<collection> [, ...]}
734730
<tuple> = (*<collection>, [...])
735731
<dict> = {**<dict> [, ...]}
736732
```
737733

734+
```python
735+
head, *body, tail = <collection>
736+
```
737+
738738

739739
Inline
740740
------

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,13 +732,13 @@ <h4 id="legalargumentcombinations">Legal argument combinations:</h4>
732732
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span><span class="hljs-params">(x, *args, z, **kwargs)</span>:</span> <span class="hljs-comment"># f(x=1, y=2, z=3) | f(1, y=2, z=3) | f(1, 2, z=3)</span>
733733
</code></pre>
734734
<h3 id="otheruses">Other Uses</h3>
735-
<pre><code class="python language-python hljs">head, *body, tail = &lt;collection&gt;
736-
</code></pre>
737735
<pre><code class="python language-python hljs">&lt;list&gt; = [*&lt;collection&gt; [, ...]]
738736
&lt;set&gt; = {*&lt;collection&gt; [, ...]}
739737
&lt;tuple&gt; = (*&lt;collection&gt;, [...])
740738
&lt;dict&gt; = {**&lt;dict&gt; [, ...]}
741739
</code></pre>
740+
<pre><code class="python language-python hljs">head, *body, tail = &lt;collection&gt;
741+
</code></pre>
742742
<h2 id="inline"><a href="#inline" name="inline">#</a>Inline</h2>
743743
<h3 id="lambda">Lambda</h3>
744744
<pre><code class="python language-python hljs">&lt;function&gt; = <span class="hljs-keyword">lambda</span>: &lt;return_value&gt;

0 commit comments

Comments
 (0)