<li><strong>By default digits, whitespaces and alphanumerics from all alphabets are matched, unless <codeclass="python hljs"><spanclass="hljs-string">'flags=re.ASCII'</span></code> argument is used.</strong></li>
<li><strong>Use capital letter for negation.</strong></li>
</ul><pre><codeclass="python language-python hljs"><spanclass="hljs-string">'\d'</span> == <spanclass="hljs-string">'[0-9]'</span><spanclass="hljs-comment"># Matches any digit.</span>
<spanclass="hljs-string">'\s'</span> == <spanclass="hljs-string">'[ \t\n\r\f\v]'</span><spanclass="hljs-comment"># Matches any whitespace.</span>
<spanclass="hljs-string">'\w'</span> == <spanclass="hljs-string">'[a-zA-Z0-9_]'</span><spanclass="hljs-comment"># Matches any alphanumeric.</span>
</code></pre></div>
@ -1232,11 +1232,11 @@ Hello World!
<li><strong>If there are no numeric values before auto(), it returns 1.</strong></li>
<li><strong>Otherwise it returns an increment of the last numeric value.</strong></li>
</ul>
<pre><codeclass="python language-python hljs"><member> = <enum>.<member_name><spanclass="hljs-comment"># Returns a member.</span>
<member> = <enum>[<spanclass="hljs-string">'<member_name>'</span>] <spanclass="hljs-comment"># Returns a member or raises KeyError.</span>
<member> = <enum>(<value>) <spanclass="hljs-comment"># Returns a member or raises ValueError.</span>
name = <member>.name
value = <member>.value
<pre><codeclass="python language-python hljs"><member> = <enum>.<member_name><spanclass="hljs-comment"># Returns a member.</span>
<member> = <enum>[<spanclass="hljs-string">'<member_name>'</span>] <spanclass="hljs-comment"># Returns a member or raises KeyError.</span>
<member> = <enum>(<value>) <spanclass="hljs-comment"># Returns a member or raises ValueError.</span>
<div><h2id="introspection"><ahref="#introspection"name="introspection">#</a>Introspection</h2><p><strong>Inspecting code at runtime.</strong></p><div><h3id="variables">Variables</h3><pre><codeclass="python language-python hljs"><list> = dir() <spanclass="hljs-comment"># Names of variables in current scope.</span>
<dict> = locals() <spanclass="hljs-comment"># Dict of local variables. Also vars().</span>
<dict> = globals() <spanclass="hljs-comment"># Dict of global variables.</span>
<div><h2id="introspection"><ahref="#introspection"name="introspection">#</a>Introspection</h2><p><strong>Inspecting code at runtime.</strong></p><div><h3id="variables">Variables</h3><pre><codeclass="python language-python hljs"><list> = dir() <spanclass="hljs-comment"># Returns names of variables in current scope.</span>
<dict> = locals() <spanclass="hljs-comment"># Returns dict of local variables. Also vars().</span>
<dict> = globals() <spanclass="hljs-comment"># Returns dict of global variables.</span>
<div><h3id="typediagram">Type Diagram</h3><pre><codeclass="python language-python hljs">type(MyClass) == MyMetaClass <spanclass="hljs-comment"># MyClass is an instance of MyMetaClass.</span>
type(MyMetaClass) == type <spanclass="hljs-comment"># MyMetaClass is an instance of type.</span>
<div><h3id="typediagram">Type Diagram</h3><pre><codeclass="python language-python hljs">type(MyClass) == MyMetaClass <spanclass="hljs-comment"># MyClass is an instance of MyMetaClass.</span>
type(MyMetaClass) == type <spanclass="hljs-comment"># MyMetaClass is an instance of type.</span>
@ -1898,8 +1898,8 @@ type(MyMetaClass) == type <span class="hljs-comment"># MyMetaClass is an
| str ---------+ |
+-------------+-------------+
</code></pre>
<div><h3id="inheritancediagram">Inheritance Diagram</h3><pre><codeclass="python language-python hljs">MyClass.__base__ == object <spanclass="hljs-comment"># MyClass is a subclass of object.</span>
MyMetaClass.__base__ == type <spanclass="hljs-comment"># MyMetaClass is a subclass of type.</span>
<div><h3id="inheritancediagram">Inheritance Diagram</h3><pre><codeclass="python language-python hljs">MyClass.__base__ == object <spanclass="hljs-comment"># MyClass is a subclass of object.</span>
MyMetaClass.__base__ == type <spanclass="hljs-comment"># MyMetaClass is a subclass of type.</span>
<li><strong>If row and column indexes differ in shape, they are combined with broadcasting.</strong></li>
</ul>
<div><h3id="broadcasting">Broadcasting</h3><p><strong>Broadcasting is a set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.</strong></p><pre><codeclass="python language-python hljs">left = [[<spanclass="hljs-number">0.1</span>], [<spanclass="hljs-number">0.6</span>], [<spanclass="hljs-number">0.8</span>]] <spanclass="hljs-comment"># Shape: (3, 1)</span>
<div><h3id="broadcasting">Broadcasting</h3><p><strong>Broadcasting is a set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.</strong></p><pre><codeclass="python language-python hljs">left = [[<spanclass="hljs-number">0.1</span>], [<spanclass="hljs-number">0.6</span>], [<spanclass="hljs-number">0.8</span>]] <spanclass="hljs-comment"># Shape: (3, 1)</span>
<div><h4id="2ifanydimensionsdifferinsizeexpandtheonesthathavesize1byduplicatingtheirelements">2. If any dimensions differ in size, expand the ones that have size 1 by duplicating their elements:</h4><pre><codeclass="python language-python hljs">left = [[<spanclass="hljs-number">0.1</span>, <spanclass="hljs-number">0.1</span>, <spanclass="hljs-number">0.1</span>], [<spanclass="hljs-number">0.6</span>, <spanclass="hljs-number">0.6</span>, <spanclass="hljs-number">0.6</span>], [<spanclass="hljs-number">0.8</span>, <spanclass="hljs-number">0.8</span>, <spanclass="hljs-number">0.8</span>]] <spanclass="hljs-comment"># Shape: (3, 3) <- !</span>