Z = dataclasses.make_dataclass('Z', ['a']); print(Z(<el>))
```
@ -1120,7 +1119,7 @@ class MyHashable:
### Sortable
* **With total_ordering decorator, you only need to provide eq() and one of lt(), gt(), le() or ge() special methods and the rest will be automatically generated.**
* **Functions sorted() and min() only require lt() method, while max() only requires gt(). However, it is best to define them all so that confusion doesn't arise in other contexts.**
* **When two lists, strings or dataclasses are compared, their values get compared in order until a pair of unequal values is found. The comparison of this two values is then returned. The shorter sequence is considered smaller in case of all elements being equal.**
* **When two lists, strings or dataclasses are compared, their values get compared in order until a pair of unequal values is found. The comparison of this two values is then returned. The shorter sequence is considered smaller in case of all values being equal.**
<li><strong>On a filesystem this corresponds to a directory of Python files with an optional init script.</strong></li>
<li><strong>Running <codeclass="python hljs"><spanclass="hljs-string">'import <package>'</span></code> does not automatically provide access to the package's modules unless they are explicitly imported in its init script.</strong></li>
</ul>
<div><h2id="closure"><ahref="#closure"name="closure">#</a>Closure</h2><p><strong>We have a closure in Python when:</strong></p><ul>
<div><h2id="closure"><ahref="#closure"name="closure">#</a>Closure</h2><p><strong>We have/get a closure in Python when:</strong></p><ul>
<li><strong>A nested function references a value of its enclosing function and then</strong></li>
<li><strong>the enclosing function returns the nested function.</strong></li>
<li><strong>Partial is also useful in cases when function needs to be passed as an argument, because it enables us to set its arguments beforehand.</strong></li>
<li><strong>Partial is also useful in cases when function needs to be passed as an argument because it enables us to set its arguments beforehand.</strong></li>
<li><strong>A few examples being: <codeclass="python hljs"><spanclass="hljs-string">'defaultdict(<function>)'</span></code>, <codeclass="python hljs"><spanclass="hljs-string">'iter(<function>, to_exclusive)'</span></code> and dataclass's <codeclass="python hljs"><spanclass="hljs-string">'field(default_factory=<function>)'</span></code>.</strong></li>
</ul>
<div><h3id="nonlocal">Non-Local</h3><p><strong>If variable is being assigned to anywhere in the scope, it is regarded as a local variable, unless it is declared as a 'global' or a 'nonlocal'.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-function"><spanclass="hljs-keyword">def</span><spanclass="hljs-title">get_counter</span><spanclass="hljs-params">()</span>:</span>
Z = dataclasses.make_dataclass(<spanclass="hljs-string">'Z'</span>, [<spanclass="hljs-string">'a'</span>]); print(Z(<el>))
</code></pre></div>
@ -943,7 +942,7 @@ Z = dataclasses.make_dataclass(<span class="hljs-string">'Z'</span>, [<span clas
<div><h3id="sortable">Sortable</h3><ul>
<li><strong>With total_ordering decorator, you only need to provide eq() and one of lt(), gt(), le() or ge() special methods and the rest will be automatically generated.</strong></li>
<li><strong>Functions sorted() and min() only require lt() method, while max() only requires gt(). However, it is best to define them all so that confusion doesn't arise in other contexts.</strong></li>
<li><strong>When two lists, strings or dataclasses are compared, their values get compared in order until a pair of unequal values is found. The comparison of this two values is then returned. The shorter sequence is considered smaller in case of all elements being equal.</strong></li>
<li><strong>When two lists, strings or dataclasses are compared, their values get compared in order until a pair of unequal values is found. The comparison of this two values is then returned. The shorter sequence is considered smaller in case of all values being equal.</strong></li>