|
|
@ -732,13 +732,13 @@ func(*args, **kwargs) |
|
|
|
<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> |
|
|
|
</code></pre> |
|
|
|
<h3 id="otheruses">Other Uses</h3> |
|
|
|
<pre><code class="python language-python hljs">head, *body, tail = <collection> |
|
|
|
</code></pre> |
|
|
|
<pre><code class="python language-python hljs"><list> = [*<collection> [, ...]] |
|
|
|
<set> = {*<collection> [, ...]} |
|
|
|
<tuple> = (*<collection>, [...]) |
|
|
|
<dict> = {**<dict> [, ...]} |
|
|
|
</code></pre> |
|
|
|
<pre><code class="python language-python hljs">head, *body, tail = <collection> |
|
|
|
</code></pre> |
|
|
|
<h2 id="inline"><a href="#inline" name="inline">#</a>Inline</h2> |
|
|
|
<h3 id="lambda">Lambda</h3> |
|
|
|
<pre><code class="python language-python hljs"><function> = <span class="hljs-keyword">lambda</span>: <return_value> |
|
|
|