|
54 | 54 |
|
55 | 55 | <body>
|
56 | 56 | <header>
|
57 |
| - <aside>July 26, 2022</aside> |
| 57 | + <aside>July 27, 2022</aside> |
58 | 58 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a>
|
59 | 59 | </header>
|
60 | 60 |
|
|
1528 | 1528 | <li><strong><code class="python hljs"><span class="hljs-string">'delimiter'</span></code> - A one-character string used to separate fields.</strong></li>
|
1529 | 1529 | <li><strong><code class="python hljs"><span class="hljs-string">'quotechar'</span></code> - Character for quoting fields that contain special characters.</strong></li>
|
1530 | 1530 | <li><strong><code class="python hljs"><span class="hljs-string">'doublequote'</span></code> - Whether quotechars inside fields are/get doubled or escaped.</strong></li>
|
1531 |
| -<li><strong><code class="python hljs"><span class="hljs-string">'skipinitialspace'</span></code> - Whether whitespace after delimiter gets stripped by reader.</strong></li> |
| 1531 | +<li><strong><code class="python hljs"><span class="hljs-string">'skipinitialspace'</span></code> - Is space character at the start of the field stripped by reader.</strong></li> |
1532 | 1532 | <li><strong><code class="python hljs"><span class="hljs-string">'lineterminator'</span></code> - How writer terminates rows. Reader is hardcoded to '\n', '\r', '\r\n'.</strong></li>
|
1533 | 1533 | <li><strong><code class="python hljs"><span class="hljs-string">'quoting'</span></code> - 0: As necessary, 1: All, 2: All but numbers which are read as floats, 3: None.</strong></li>
|
1534 | 1534 | <li><strong><code class="python hljs"><span class="hljs-string">'escapechar'</span></code> - Character for escaping quotechars if doublequote is False.</strong></li>
|
@@ -1810,11 +1810,11 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
|
1810 | 1810 | delattr(<object>, <span class="hljs-string">'<attr_name>'</span>) <span class="hljs-comment"># Same. Also `del <object>.<attr_name>`.</span>
|
1811 | 1811 | </code></pre></div>
|
1812 | 1812 |
|
1813 |
| -<div><h3 id="parameters-1">Parameters</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> inspect <span class="hljs-keyword">import</span> signature |
1814 |
| -<Sig> = signature(<function>) <span class="hljs-comment"># Function's Signature object.</span> |
1815 |
| -<dict> = <Sig>.parameters <span class="hljs-comment"># Dict of function's Parameter objects.</span> |
1816 |
| -<str> = <Param>.name <span class="hljs-comment"># Parameter's name.</span> |
| 1813 | +<div><h3 id="parameters-1">Parameters</h3><pre><code class="python language-python hljs"><Sig> = inspect.signature(<function>) <span class="hljs-comment"># Function's Signature object.</span> |
| 1814 | +<dict> = <Sig>.parameters <span class="hljs-comment"># Dict of Parameter objects.</span> |
1817 | 1815 | <memb> = <Param>.kind <span class="hljs-comment"># Member of ParameterKind enum.</span>
|
| 1816 | +<obj> = <Param>.default <span class="hljs-comment"># Default value or <Param>.empty.</span> |
| 1817 | +<type> = <Param>.annotation <span class="hljs-comment"># Type or <Param>.empty.</span> |
1818 | 1818 | </code></pre></div>
|
1819 | 1819 |
|
1820 | 1820 | <div><h2 id="metaprogramming"><a href="#metaprogramming" name="metaprogramming">#</a>Metaprogramming</h2><p><strong>Code that generates code.</strong></p><div><h3 id="type-1">Type</h3><p><strong>Type is the root class. If only passed an object it returns its type (class). Otherwise it creates a new class.</strong></p><pre><code class="python language-python hljs"><class> = type(<span class="hljs-string">'<class_name>'</span>, <tuple_of_parents>, <dict_of_class_attributes>)</code></pre></div></div>
|
@@ -2905,7 +2905,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
|
2905 | 2905 |
|
2906 | 2906 |
|
2907 | 2907 | <footer>
|
2908 |
| - <aside>July 26, 2022</aside> |
| 2908 | + <aside>July 27, 2022</aside> |
2909 | 2909 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a>
|
2910 | 2910 | </footer>
|
2911 | 2911 |
|
|
0 commit comments