Browse Source

Tables fixed

pull/46/head
Jure Šorn 5 years ago
parent
commit
9532bf0ae7
3 changed files with 232 additions and 245 deletions
  1. 176
      README.md
  2. 180
      index.html
  3. 121
      web/script_2.js

176
README.md

@ -270,13 +270,13 @@ True
```
```text
+------------------+----------+------------+----------+
| | Sequence | Collection | Iterable |
+------------------+----------+------------+----------+
| list, range, str | yes | yes | yes |
| dict, set | | yes | yes |
| iter | | | yes |
+------------------+----------+------------+----------+
+------------------+------------+------------+------------+
| | Sequence | Collection | Iterable |
+------------------+------------+------------+------------+
| list, range, str | yes | yes | yes |
| dict, set | | yes | yes |
| iter | | | yes |
+------------------+------------+------------+------------+
```
```python
@ -286,15 +286,15 @@ True
```
```text
+--------------------+----------+----------+--------+---------+--------+
| | Integral | Rational | Real | Complex | Number |
+--------------------+----------+----------+--------+---------+--------+
| int | yes | yes | yes | yes | yes |
| fractions.Fraction | | yes | yes | yes | yes |
| float | | | yes | yes | yes |
| complex | | | | yes | yes |
| decimal.Decimal | | | | | yes |
+--------------------+----------+----------+--------+---------+--------+
+--------------------+----------+----------+----------+----------+----------+
| | Integral | Rational | Real | Complex | Number |
+--------------------+----------+----------+----------+----------+----------+
| int | yes | yes | yes | yes | yes |
| fractions.Fraction | | yes | yes | yes | yes |
| float | | | yes | yes | yes |
| complex | | | | yes | yes |
| decimal.Decimal | | | | | yes |
+--------------------+----------+----------+----------+----------+----------+
```
@ -443,32 +443,32 @@ Format
#### Comparison of float presentation types:
```text
+----------------+----------------+---------------+----------------+-----------------+
| | {<float>} | {<float>:f} | {<float>:e} | {<float>:%} |
+----------------+----------------+---------------+----------------+-----------------+
| 0.000056789 | '5.6789e-05' | '0.000057' | '5.678900e-05' | '0.005679%' |
| 0.00056789 | '0.00056789' | '0.000568' | '5.678900e-04' | '0.056789%' |
| 0.0056789 | '0.0056789' | '0.005679' | '5.678900e-03' | '0.567890%' |
| 0.056789 | '0.056789' | '0.056789' | '5.678900e-02' | '5.678900%' |
| 0.56789 | '0.56789' | '0.567890' | '5.678900e-01' | '56.789000%' |
| 5.6789 | '5.6789' | '5.678900' | '5.678900e+00' | '567.890000%' |
| 56.789 | '56.789' | '56.789000' | '5.678900e+01' | '5678.900000%' |
| 567.89 | '567.89' | '567.890000' | '5.678900e+02' | '56789.000000%' |
+----------------+----------------+---------------+----------------+-----------------+
+---------------+-----------------+-----------------+-----------------+-----------------+
| | {<float>} | {<float>:f} | {<float>:e} | {<float>:%} |
+---------------+-----------------+-----------------+-----------------+-----------------+
| 0.000056789 | '5.6789e-05' | '0.000057' | '5.678900e-05' | '0.005679%' |
| 0.00056789 | '0.00056789' | '0.000568' | '5.678900e-04' | '0.056789%' |
| 0.0056789 | '0.0056789' | '0.005679' | '5.678900e-03' | '0.567890%' |
| 0.056789 | '0.056789' | '0.056789' | '5.678900e-02' | '5.678900%' |
| 0.56789 | '0.56789' | '0.567890' | '5.678900e-01' | '56.789000%' |
| 5.6789 | '5.6789' | '5.678900' | '5.678900e+00' | '567.890000%' |
| 56.789 | '56.789' | '56.789000' | '5.678900e+01' | '5678.900000%' |
| 567.89 | '567.89' | '567.890000' | '5.678900e+02' | '56789.000000%' |
+---------------+-----------------+-----------------+-----------------+-----------------+
```
```text
+----------------+----------------+---------------+----------------+-----------------+
| | {<float>:.2} | {<float>:.2f} | {<float>:.2e} | {<float>:.2%} |
+----------------+----------------+---------------+----------------+-----------------+
| 0.000056789 | '5.7e-05' | '0.00' | '5.68e-05' | '0.01%' |
| 0.00056789 | '0.00057' | '0.00' | '5.68e-04' | '0.06%' |
| 0.0056789 | '0.0057' | '0.01' | '5.68e-03' | '0.57%' |
| 0.056789 | '0.057' | '0.06' | '5.68e-02' | '5.68%' |
| 0.56789 | '0.57' | '0.57' | '5.68e-01' | '56.79%' |
| 5.6789 | '5.7' | '5.68' | '5.68e+00' | '567.89%' |
| 56.789 | '5.7e+01' | '56.79' | '5.68e+01' | '5678.90%' |
| 567.89 | '5.7e+02' | '567.89' | '5.68e+02' | '56789.00%' |
+----------------+----------------+---------------+----------------+-----------------+
+---------------+-----------------+-----------------+-----------------+-----------------+
| | {<float>:.2} | {<float>:.2f} | {<float>:.2e} | {<float>:.2%} |
+---------------+-----------------+-----------------+-----------------+-----------------+
| 0.000056789 | '5.7e-05' | '0.00' | '5.68e-05' | '0.01%' |
| 0.00056789 | '0.00057' | '0.00' | '5.68e-04' | '0.06%' |
| 0.0056789 | '0.0057' | '0.01' | '5.68e-03' | '0.57%' |
| 0.056789 | '0.057' | '0.06' | '5.68e-02' | '5.68%' |
| 0.56789 | '0.57' | '0.57' | '5.68e-01' | '56.79%' |
| 5.6789 | '5.7' | '5.68' | '5.68e+00' | '567.89%' |
| 56.789 | '5.7e+01' | '56.79' | '5.68e+01' | '5678.90%' |
| 567.89 | '5.7e+02' | '567.89' | '5.68e+02' | '56789.00%' |
+---------------+-----------------+-----------------+-----------------+-----------------+
```
### Ints
@ -1274,17 +1274,17 @@ class MyAbcSequence(collections.abc.Sequence):
#### Table of required and available special methods:
```text
+------------+----------+------------+----------+--------------+
| | Iterable | Collection | Sequence | abc.Sequence |
+------------+----------+------------+----------+--------------+
| iter() | REQ | REQ | yes | yes |
| contains() | yes | yes | yes | yes |
| len() | | REQ | REQ | REQ |
| getitem() | | | REQ | REQ |
| reversed() | | | yes | yes |
| index() | | | | yes |
| count() | | | | yes |
+------------+----------+------------+----------+--------------+
+------------+------------+------------+------------+--------------+
| | Iterable | Collection | Sequence | abc.Sequence |
+------------+------------+------------+------------+--------------+
| iter() | REQ | REQ | yes | yes |
| contains() | yes | yes | yes | yes |
| len() | | REQ | REQ | REQ |
| getitem() | | | REQ | REQ |
| reversed() | | | yes | yes |
| index() | | | | yes |
| count() | | | | yes |
+------------+------------+------------+------------+--------------+
```
* **Other ABCs that generate missing methods are: MutableSequence, Set, MutableSet, Mapping and MutableMapping.**
* **Names of their required methods are stored in `'<abc>.__abstractmethods__'`.**
@ -1421,14 +1421,14 @@ BaseException
#### Collections and their exceptions:
```text
+-----------+------------+----------+----------+
| | list | dict | set |
+-----------+------------+----------+----------+
| getitem() | IndexError | KeyError | |
| pop() | IndexError | KeyError | KeyError |
| remove() | ValueError | | KeyError |
| index() | ValueError | | |
+-----------+------------+----------+----------+
+-----------+------------+------------+------------+
| | list | dict | set |
+-----------+------------+------------+------------+
| getitem() | IndexError | KeyError | |
| pop() | IndexError | KeyError | KeyError |
| remove() | ValueError | | KeyError |
| index() | ValueError | | |
+-----------+------------+------------+------------+
```
### User-defined Exceptions
@ -1770,17 +1770,17 @@ import csv
### Dialects
```text
+------------------+-----------+-----------+--------------+
| | excel | excel_tab | unix_dialect |
+------------------+-----------+-----------+--------------+
| delimiter | ',' | '\t' | ',' |
| quotechar | '"' | '"' | '"' |
| doublequote | True | True | True |
| skipinitialspace | False | False | False |
| lineterminator | '\r\n' | '\r\n' | '\n' |
| quoting | 0 | 0 | 1 |
| escapechar | None | None | None |
+------------------+-----------+-----------+--------------+
+------------------+--------------+--------------+--------------+
| | excel | excel_tab | unix_dialect |
+------------------+--------------+--------------+--------------+
| delimiter | ',' | '\t' | ',' |
| quotechar | '"' | '"' | '"' |
| doublequote | True | True | True |
| skipinitialspace | False | False | False |
| lineterminator | '\r\n' | '\r\n' | '\n' |
| quoting | 0 | 0 | 1 |
| escapechar | None | None | None |
+------------------+--------------+--------------+--------------+
```
### Read Rows from CSV File
@ -2169,15 +2169,15 @@ type(MyMetaClass) == type # MyMetaClass is an instance of type.
```
```text
+---------+-------------+
| Classes | Metaclasses |
+---------+-------------|
| MyClass > MyMetaClass |
| | v |
| object ---> type <+ |
| | ^ +---+ |
| str -------+ |
+---------+-------------+
+-------------+-------------+
| Classes | Metaclasses |
+-------------+-------------|
| MyClass --> MyMetaClass |
| | v |
| object -----> type <+ |
| | ^ +---+ |
| str ---------+ |
+-------------+-------------+
```
### Inheritance Diagram
@ -2187,15 +2187,15 @@ MyMetaClass.__base__ == type # MyMetaClass is a subclass of type.
```
```text
+---------+-------------+
| Classes | Metaclasses |
+---------+-------------|
| MyClass | MyMetaClass |
| v | v |
| object <--- type |
| ^ | |
| str | |
+---------+-------------+
+-------------+-------------+
| Classes | Metaclasses |
+-------------+-------------|
| MyClass | MyMetaClass |
| v | v |
| object <----- type |
| ^ | |
| str | |
+-------------+-------------+
```

180
index.html

@ -395,27 +395,27 @@ to_exclusive = &lt;range&gt;.stop
</code></pre></div>
<pre><code class="text language-text">+------------------+----------+------------+----------+
| | Sequence | Collection | Iterable |
+------------------+----------+------------+----------+
| list, range, str | yes | yes | yes |
| dict, set | | yes | yes |
| iter | | | yes |
+------------------+----------+------------+----------+
<pre><code class="text language-text">+------------------+------------+------------+------------+
| | Sequence | Collection | Iterable |
+------------------+------------+------------+------------+
| list, range, str | yes | yes | yes |
| dict, set | | yes | yes |
| iter | | | yes |
+------------------+------------+------------+------------+
</code></pre>
<pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> numbers <span class="hljs-keyword">import</span> Integral, Rational, Real, Complex, Number
<span class="hljs-meta">&gt;&gt;&gt; </span>isinstance(<span class="hljs-number">123</span>, Number)
<span class="hljs-keyword">True</span>
</code></pre>
<pre><code class="text language-text">+--------------------+----------+----------+--------+---------+--------+
| | Integral | Rational | Real | Complex | Number |
+--------------------+----------+----------+--------+---------+--------+
| int | yes | yes | yes | yes | yes |
| fractions.Fraction | | yes | yes | yes | yes |
| float | | | yes | yes | yes |
| complex | | | | yes | yes |
| decimal.Decimal | | | | | yes |
+--------------------+----------+----------+--------+---------+--------+
<pre><code class="text language-text">+--------------------+----------+----------+----------+----------+----------+
| | Integral | Rational | Real | Complex | Number |
+--------------------+----------+----------+----------+----------+----------+
| int | yes | yes | yes | yes | yes |
| fractions.Fraction | | yes | yes | yes | yes |
| float | | | yes | yes | yes |
| complex | | | | yes | yes |
| decimal.Decimal | | | | | yes |
+--------------------+----------+----------+----------+----------+----------+
</code></pre>
<div><h2 id="string"><a href="#string" name="string">#</a>String</h2><pre><code class="python language-python hljs">&lt;str&gt; = &lt;str&gt;.strip() <span class="hljs-comment"># Strips all whitespace characters from both ends.</span>
&lt;str&gt; = &lt;str&gt;.strip(<span class="hljs-string">'&lt;chars&gt;'</span>) <span class="hljs-comment"># Strips all passed characters from both ends.</span>
@ -531,32 +531,32 @@ to_exclusive = &lt;range&gt;.stop
{<span class="hljs-number">1.23456</span>:<span class="hljs-number">10.3</span>%} <span class="hljs-comment"># ' 123.456%'</span>
</code></pre></div>
<div><h4 id="comparisonoffloatpresentationtypes">Comparison of float presentation types:</h4><pre><code class="text language-text">+----------------+----------------+---------------+----------------+-----------------+
| | {&lt;float&gt;} | {&lt;float&gt;:f} | {&lt;float&gt;:e} | {&lt;float&gt;:%} |
+----------------+----------------+---------------+----------------+-----------------+
| 0.000056789 | '5.6789e-05' | '0.000057' | '5.678900e-05' | '0.005679%' |
| 0.00056789 | '0.00056789' | '0.000568' | '5.678900e-04' | '0.056789%' |
| 0.0056789 | '0.0056789' | '0.005679' | '5.678900e-03' | '0.567890%' |
| 0.056789 | '0.056789' | '0.056789' | '5.678900e-02' | '5.678900%' |
| 0.56789 | '0.56789' | '0.567890' | '5.678900e-01' | '56.789000%' |
| 5.6789 | '5.6789' | '5.678900' | '5.678900e+00' | '567.890000%' |
| 56.789 | '56.789' | '56.789000' | '5.678900e+01' | '5678.900000%' |
| 567.89 | '567.89' | '567.890000' | '5.678900e+02' | '56789.000000%' |
+----------------+----------------+---------------+----------------+-----------------+
</code></pre></div>
<pre><code class="text language-text">+----------------+----------------+---------------+----------------+-----------------+
| | {&lt;float&gt;:.2} | {&lt;float&gt;:.2f} | {&lt;float&gt;:.2e} | {&lt;float&gt;:.2%} |
+----------------+----------------+---------------+----------------+-----------------+
| 0.000056789 | '5.7e-05' | '0.00' | '5.68e-05' | '0.01%' |
| 0.00056789 | '0.00057' | '0.00' | '5.68e-04' | '0.06%' |
| 0.0056789 | '0.0057' | '0.01' | '5.68e-03' | '0.57%' |
| 0.056789 | '0.057' | '0.06' | '5.68e-02' | '5.68%' |
| 0.56789 | '0.57' | '0.57' | '5.68e-01' | '56.79%' |
| 5.6789 | '5.7' | '5.68' | '5.68e+00' | '567.89%' |
| 56.789 | '5.7e+01' | '56.79' | '5.68e+01' | '5678.90%' |
| 567.89 | '5.7e+02' | '567.89' | '5.68e+02' | '56789.00%' |
+----------------+----------------+---------------+----------------+-----------------+
<div><h4 id="comparisonoffloatpresentationtypes">Comparison of float presentation types:</h4><pre><code class="text language-text">+---------------+-----------------+-----------------+-----------------+-----------------+
| | {&lt;float&gt;} | {&lt;float&gt;:f} | {&lt;float&gt;:e} | {&lt;float&gt;:%} |
+---------------+-----------------+-----------------+-----------------+-----------------+
| 0.000056789 | '5.6789e-05' | '0.000057' | '5.678900e-05' | '0.005679%' |
| 0.00056789 | '0.00056789' | '0.000568' | '5.678900e-04' | '0.056789%' |
| 0.0056789 | '0.0056789' | '0.005679' | '5.678900e-03' | '0.567890%' |
| 0.056789 | '0.056789' | '0.056789' | '5.678900e-02' | '5.678900%' |
| 0.56789 | '0.56789' | '0.567890' | '5.678900e-01' | '56.789000%' |
| 5.6789 | '5.6789' | '5.678900' | '5.678900e+00' | '567.890000%' |
| 56.789 | '56.789' | '56.789000' | '5.678900e+01' | '5678.900000%' |
| 567.89 | '567.89' | '567.890000' | '5.678900e+02' | '56789.000000%' |
+---------------+-----------------+-----------------+-----------------+-----------------+
</code></pre></div>
<pre><code class="text language-text">+---------------+-----------------+-----------------+-----------------+-----------------+
| | {&lt;float&gt;:.2} | {&lt;float&gt;:.2f} | {&lt;float&gt;:.2e} | {&lt;float&gt;:.2%} |
+---------------+-----------------+-----------------+-----------------+-----------------+
| 0.000056789 | '5.7e-05' | '0.00' | '5.68e-05' | '0.01%' |
| 0.00056789 | '0.00057' | '0.00' | '5.68e-04' | '0.06%' |
| 0.0056789 | '0.0057' | '0.01' | '5.68e-03' | '0.57%' |
| 0.056789 | '0.057' | '0.06' | '5.68e-02' | '5.68%' |
| 0.56789 | '0.57' | '0.57' | '5.68e-01' | '56.79%' |
| 5.6789 | '5.7' | '5.68' | '5.68e+00' | '567.89%' |
| 56.789 | '5.7e+01' | '56.79' | '5.68e+01' | '5678.90%' |
| 567.89 | '5.7e+02' | '567.89' | '5.68e+02' | '56789.00%' |
+---------------+-----------------+-----------------+-----------------+-----------------+
</code></pre>
<div><h3 id="ints">Ints</h3><pre><code class="python language-python hljs">{<span class="hljs-number">90</span>:c} <span class="hljs-comment"># 'Z'</span>
{<span class="hljs-number">90</span>:X} <span class="hljs-comment"># '5A'</span>
@ -1204,17 +1204,17 @@ Hello World!
</code></pre></div>
<div><h4 id="tableofrequiredandavailablespecialmethods">Table of required and available special methods:</h4><pre><code class="text language-text">+------------+----------+------------+----------+--------------+
| | Iterable | Collection | Sequence | abc.Sequence |
+------------+----------+------------+----------+--------------+
| iter() | REQ | REQ | yes | yes |
| contains() | yes | yes | yes | yes |
| len() | | REQ | REQ | REQ |
| getitem() | | | REQ | REQ |
| reversed() | | | yes | yes |
| index() | | | | yes |
| count() | | | | yes |
+------------+----------+------------+----------+--------------+
<div><h4 id="tableofrequiredandavailablespecialmethods">Table of required and available special methods:</h4><pre><code class="text language-text">+------------+------------+------------+------------+--------------+
| | Iterable | Collection | Sequence | abc.Sequence |
+------------+------------+------------+------------+--------------+
| iter() | REQ | REQ | yes | yes |
| contains() | yes | yes | yes | yes |
| len() | | REQ | REQ | REQ |
| getitem() | | | REQ | REQ |
| reversed() | | | yes | yes |
| index() | | | | yes |
| count() | | | | yes |
+------------+------------+------------+------------+--------------+
</code></pre></div>
<ul>
@ -1327,14 +1327,14 @@ LogicOp = Enum(<span class="hljs-string">'LogicOp'</span>, {<span class="hljs-st
+-- UnicodeError # Raised when encoding/decoding strings from/to bytes fails.
</code></pre></div>
<div><h4 id="collectionsandtheirexceptions">Collections and their exceptions:</h4><pre><code class="text language-text">+-----------+------------+----------+----------+
| | list | dict | set |
+-----------+------------+----------+----------+
| getitem() | IndexError | KeyError | |
| pop() | IndexError | KeyError | KeyError |
| remove() | ValueError | | KeyError |
| index() | ValueError | | |
+-----------+------------+----------+----------+
<div><h4 id="collectionsandtheirexceptions">Collections and their exceptions:</h4><pre><code class="text language-text">+-----------+------------+------------+------------+
| | list | dict | set |
+-----------+------------+------------+------------+
| getitem() | IndexError | KeyError | |
| pop() | IndexError | KeyError | KeyError |
| remove() | ValueError | | KeyError |
| index() | ValueError | | |
+-----------+------------+------------+------------+
</code></pre></div>
<div><h3 id="userdefinedexceptions">User-defined Exceptions</h3><pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyError</span><span class="hljs-params">(Exception)</span>:</span>
@ -1586,17 +1586,17 @@ shutil.copytree(from, to) <span class="hljs-comment"># Copies the enti
<li><strong><code class="python hljs"><span class="hljs-string">'lineterminator'</span></code> - How does writer terminate lines.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'quoting'</span></code> - Controls the amount of quoting: 0 - as necessary, 1 - all.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'escapechar'</span></code> - Character for escaping 'quotechar' if 'doublequote' is false.</strong></li>
</ul><div><h3 id="dialects">Dialects</h3><pre><code class="text language-text">+------------------+-----------+-----------+--------------+
| | excel | excel_tab | unix_dialect |
+------------------+-----------+-----------+--------------+
| delimiter | ',' | '\t' | ',' |
| quotechar | '"' | '"' | '"' |
| doublequote | True | True | True |
| skipinitialspace | False | False | False |
| lineterminator | '\r\n' | '\r\n' | '\n' |
| quoting | 0 | 0 | 1 |
| escapechar | None | None | None |
+------------------+-----------+-----------+--------------+
</ul><div><h3 id="dialects">Dialects</h3><pre><code class="text language-text">+------------------+--------------+--------------+--------------+
| | excel | excel_tab | unix_dialect |
+------------------+--------------+--------------+--------------+
| delimiter | ',' | '\t' | ',' |
| quotechar | '"' | '"' | '"' |
| doublequote | True | True | True |
| skipinitialspace | False | False | False |
| lineterminator | '\r\n' | '\r\n' | '\n' |
| quoting | 0 | 0 | 1 |
| escapechar | None | None | None |
+------------------+--------------+--------------+--------------+
</code></pre></div></div>
@ -1885,29 +1885,29 @@ param_names = list(&lt;sig&gt;.parameters.keys())
type(MyMetaClass) == type <span class="hljs-comment"># MyMetaClass is an instance of type.</span>
</code></pre></div>
<pre><code class="text language-text">+---------+-------------+
| Classes | Metaclasses |
+---------+-------------|
| MyClass &gt; MyMetaClass |
| | v |
| object ---&gt; type &lt;+ |
| | ^ +---+ |
| str -------+ |
+---------+-------------+
<pre><code class="text language-text">+-------------+-------------+
| Classes | Metaclasses |
+-------------+-------------|
| MyClass --&gt; MyMetaClass |
| | v |
| object -----&gt; type &lt;+ |
| | ^ +---+ |
| str ---------+ |
+-------------+-------------+
</code></pre>
<div><h3 id="inheritancediagram">Inheritance Diagram</h3><pre><code class="python language-python hljs">MyClass.__base__ == object <span class="hljs-comment"># MyClass is a subclass of object.</span>
MyMetaClass.__base__ == type <span class="hljs-comment"># MyMetaClass is a subclass of type.</span>
</code></pre></div>
<pre><code class="text language-text">+---------+-------------+
| Classes | Metaclasses |
+---------+-------------|
| MyClass | MyMetaClass |
| v | v |
| object &lt;--- type |
| ^ | |
| str | |
+---------+-------------+
<pre><code class="text language-text">+-------------+-------------+
| Classes | Metaclasses |
+-------------+-------------|
| MyClass | MyMetaClass |
| v | v |
| object &lt;----- type |
| ^ | |
| str | |
+-------------+-------------+
</code></pre>
<div><h2 id="eval"><a href="#eval" name="eval">#</a>Eval</h2><pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> ast <span class="hljs-keyword">import</span> literal_eval
<span class="hljs-meta">&gt;&gt;&gt; </span>literal_eval(<span class="hljs-string">'1 + 2'</span>)

121
web/script_2.js

@ -1,8 +1,8 @@
const DIAGRAM_1_A =
'+---------+-------------+\n' +
'| Classes | Metaclasses |\n' +
'+---------+-------------|\n' +
'| MyClass > MyMetaClass |\n';
'+-------------+-------------+\n' +
'| Classes | Metaclasses |\n' +
'+-------------+-------------|\n' +
'| MyClass --> MyMetaClass |\n';
const DIAGRAM_1_B =
'┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┓\n' +
@ -16,10 +16,10 @@ const DIAGRAM_1_B =
'┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┛\n';
const DIAGRAM_2_A =
'+---------+-------------+\n' +
'| Classes | Metaclasses |\n' +
'+---------+-------------|\n' +
'| MyClass | MyMetaClass |\n';
'+-------------+-------------+\n' +
'| Classes | Metaclasses |\n' +
'+-------------+-------------|\n' +
'| MyClass | MyMetaClass |\n';
const DIAGRAM_2_B =
'┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┓\n' +
@ -33,9 +33,9 @@ const DIAGRAM_2_B =
'┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┛\n';
const DIAGRAM_3_A =
'+------------------+----------+------------+----------+\n' +
'| | Sequence | Collection | Iterable |\n' +
'+------------------+----------+------------+----------+\n';
'+------------------+------------+------------+------------+\n' +
'| | Sequence | Collection | Iterable |\n' +
'+------------------+------------+------------+------------+\n';
const DIAGRAM_3_B =
'┏━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┓\n' +
@ -47,9 +47,9 @@ const DIAGRAM_3_B =
'┗━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┛\n';
const DIAGRAM_4_A =
'+--------------------+----------+----------+--------+---------+--------+\n' +
'| | Integral | Rational | Real | Complex | Number |\n' +
'+--------------------+----------+----------+--------+---------+--------+\n';
'+--------------------+----------+----------+----------+----------+----------+\n' +
'| | Integral | Rational | Real | Complex | Number |\n' +
'+--------------------+----------+----------+----------+----------+----------+\n';
const DIAGRAM_4_B =
'┏━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━┓\n' +
@ -63,62 +63,49 @@ const DIAGRAM_4_B =
'┗━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━┛\n';
const DIAGRAM_5_A =
"+----------------+----------------+---------------+----------------+-----------------+\n" +
"| | {<float>} | {<float>:f} | {<float>:e} | {<float>:%} |\n" +
"+----------------+----------------+---------------+----------------+-----------------+\n";
"+---------------+-----------------+-----------------+-----------------+-----------------+\n" +
"| | {<float>} | {<float>:f} | {<float>:e} | {<float>:%} |\n" +
"+---------------+-----------------+-----------------+-----------------+-----------------+\n";
const DIAGRAM_5_B =
"┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┓\n" +
"┃ │ {&lt;float&gt;} │ {&lt;float&gt;:f} │ {&lt;float&gt;:e} │ {&lt;float&gt;:%} ┃\n" +
"┠───────────────┼────────────────┼─────────────────┼─────────────────┼─────────────────┨\n" +
"┃ 0.000056789 │ '5.6789e-05' │ '0.000057' │ '5.678900e-05' │ '0.005679%' ┃\n" +
"┃ 0.00056789 │ '0.00056789' │ '0.000568' │ '5.678900e-04' │ '0.056789%' ┃\n" +
"┃ 0.0056789 │ '0.0056789' │ '0.005679' │ '5.678900e-03' │ '0.567890%' ┃\n" +
"┃ 0.056789 │ '0.056789' │ '0.056789' │ '5.678900e-02' │ '5.678900%' ┃\n" +
"┃ 0.56789 │ '0.56789' │ '0.567890' │ '5.678900e-01' │ '56.789000%' ┃\n" +
"┃ 5.6789 │ '5.6789' │ '5.678900' │ '5.678900e+00' │ '567.890000%' ┃\n" +
"┃ 56.789 │ '56.789' │ '56.789000' │ '5.678900e+01' │ '5678.900000%' ┃\n" +
"┃ 567.89 │ '567.89' │ '567.890000' │ '5.678900e+02' │ '56789.000000%' ┃\n" +
"┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┛\n";
"┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┓\n" +
"┃ │ {&lt;float&gt;} │ {&lt;float&gt;:f} │ {&lt;float&gt;:e} │ {&lt;float&gt;:%} ┃\n" +
"┠───────────────┼────────────────┼─────────────────┼─────────────────┼─────────────────┨\n" +
"┃ 0.000056789 │ '5.6789e-05' │ '0.000057' │ '5.678900e-05' │ '0.005679%' ┃\n" +
"┃ 0.00056789 │ '0.00056789' │ '0.000568' │ '5.678900e-04' │ '0.056789%' ┃\n" +
"┃ 0.0056789 │ '0.0056789' │ '0.005679' │ '5.678900e-03' │ '0.567890%' ┃\n" +
"┃ 0.056789 │ '0.056789' │ '0.056789' │ '5.678900e-02' │ '5.678900%' ┃\n" +
"┃ 0.56789 │ '0.56789' │ '0.567890' │ '5.678900e-01' │ '56.789000%' ┃\n" +
"┃ 5.6789 │ '5.6789' │ '5.678900' │ '5.678900e+00' │ '567.890000%' ┃\n" +
"┃ 56.789 │ '56.789' │ '56.789000' │ '5.678900e+01' │ '5678.900000%' ┃\n" +
"┃ 567.89 │ '567.89' │ '567.890000' │ '5.678900e+02' │ '56789.000000%' ┃\n" +
"┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┛\n";
const DIAGRAM_6_A =
"+----------------+----------------+---------------+----------------+-----------------+\n" +
"| | {<float>:.2} | {<float>:.2f} | {<float>:.2e} | {<float>:.2%} |\n" +
"+----------------+----------------+---------------+----------------+-----------------+\n";
"+---------------+-----------------+-----------------+-----------------+-----------------+\n" +
"| | {<float>:.2} | {<float>:.2f} | {<float>:.2e} | {<float>:.2%} |\n" +
"+---------------+-----------------+-----------------+-----------------+-----------------+\n";
const DIAGRAM_6_B =
"┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┓\n" +
"┃ │ {&lt;float&gt;:.2} │ {&lt;float&gt;:.2f} │ {&lt;float&gt;:.2e} │ {&lt;float&gt;:.2%} ┃\n" +
"┠───────────────┼────────────────┼─────────────────┼─────────────────┼─────────────────┨\n" +
"┃ 0.000056789 │ '5.7e-05' │ '0.00' │ '5.68e-05' │ '0.01%' ┃\n" +
"┃ 0.00056789 │ '0.00057' │ '0.00' │ '5.68e-04' │ '0.06%' ┃\n" +
"┃ 0.0056789 │ '0.0057' │ '0.01' │ '5.68e-03' │ '0.57%' ┃\n" +
"┃ 0.056789 │ '0.057' │ '0.06' │ '5.68e-02' │ '5.68%' ┃\n" +
"┃ 0.56789 │ '0.57' │ '0.57' │ '5.68e-01' │ '56.79%' ┃\n" +
"┃ 5.6789 │ '5.7' │ '5.68' │ '5.68e+00' │ '567.89%' ┃\n" +
"┃ 56.789 │ '5.7e+01' │ '56.79' │ '5.68e+01' │ '5678.90%' ┃\n" +
"┃ 567.89 │ '5.7e+02' │ '567.89' │ '5.68e+02' │ '56789.00%' ┃\n" +
"┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┛\n";
"┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┓\n" +
"┃ │ {&lt;float&gt;:.2} │ {&lt;float&gt;:.2f} │ {&lt;float&gt;:.2e} │ {&lt;float&gt;:.2%} ┃\n" +
"┠───────────────┼────────────────┼─────────────────┼─────────────────┼─────────────────┨\n" +
"┃ 0.000056789 │ '5.7e-05' │ '0.00' │ '5.68e-05' │ '0.01%' ┃\n" +
"┃ 0.00056789 │ '0.00057' │ '0.00' │ '5.68e-04' │ '0.06%' ┃\n" +
"┃ 0.0056789 │ '0.0057' │ '0.01' │ '5.68e-03' │ '0.57%' ┃\n" +
"┃ 0.056789 │ '0.057' │ '0.06' │ '5.68e-02' │ '5.68%' ┃\n" +
"┃ 0.56789 │ '0.57' │ '0.57' │ '5.68e-01' │ '56.79%' ┃\n" +
"┃ 5.6789 │ '5.7' │ '5.68' │ '5.68e+00' │ '567.89%' ┃\n" +
"┃ 56.789 │ '5.7e+01' │ '56.79' │ '5.68e+01' │ '5678.90%' ┃\n" +
"┃ 567.89 │ '5.7e+02' │ '567.89' │ '5.68e+02' │ '56789.00%' ┃\n" +
"┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┛\n";
const DIAGRAM_7_A =
'+------------+----------+------------+----------+--------------+\n' +
'| | Iterable | Collection | Sequence | abc.Sequence |\n' +
'+------------+----------+------------+----------+--------------+\n';
'+------------+------------+------------+------------+--------------+\n' +
'| | Iterable | Collection | Sequence | abc.Sequence |\n' +
'+------------+------------+------------+------------+--------------+\n';
const DIAGRAM_7_B =
'┏━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓\n' +
'┃ │ Iterable │ Collection │ Sequence │ abc.Sequence ┃\n' +
'┠────────────┼──────────────┼──────────────┼──────────────┼──────────────┨\n' +
'┃ iter() │ ! │ ! │ ✓ │ ✓ ┃\n' +
'┃ contains() │ ✓ │ ✓ │ ✓ │ ✓ ┃\n' +
'┃ len() │ │ ! │ ! │ ! ┃\n' +
'┃ getitem() │ │ │ ! │ ! ┃\n' +
'┃ reversed() │ │ │ ✓ │ ✓ ┃\n' +
'┃ index() │ │ │ │ ✓ ┃\n' +
'┃ count() │ │ │ │ ✓ ┃\n' +
'┗━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛\n';
const DIAGRAM_7_C =
'┏━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓\n' +
'┃ │ Iterable │ Collection │ Sequence │ abc.Sequence ┃\n' +
'┠────────────┼────────────┼────────────┼────────────┼──────────────┨\n' +
@ -158,9 +145,9 @@ const DIAGRAM_8_B =
" └── UnicodeError <span class='hljs-comment'># Raised when encoding/decoding strings from/to bytes fails.</span>\n";
const DIAGRAM_9_A =
'+------------------+-----------+-----------+--------------+\n' +
'| | excel | excel_tab | unix_dialect |\n' +
'+------------------+-----------+-----------+--------------+\n';
'+------------------+--------------+--------------+--------------+\n' +
'| | excel | excel_tab | unix_dialect |\n' +
'+------------------+--------------+--------------+--------------+\n';
const DIAGRAM_9_B =
"┏━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓\n" +
@ -176,9 +163,9 @@ const DIAGRAM_9_B =
"┗━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛\n";
const DIAGRAM_10_A =
'+-----------+------------+----------+----------+\n' +
'| | list | dict | set |\n' +
'+-----------+------------+----------+----------+\n';
'+-----------+------------+------------+------------+\n' +
'| | list | dict | set |\n' +
'+-----------+------------+------------+------------+\n';
const DIAGRAM_10_B =
'┏━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┓\n' +
@ -230,7 +217,7 @@ if (isFontAvailable('Menlo')) {
$(`code:contains(${DIAGRAM_4_A})`).html(DIAGRAM_4_B);
$(`code:contains(${DIAGRAM_5_A})`).html(DIAGRAM_5_B);
$(`code:contains(${DIAGRAM_6_A})`).html(DIAGRAM_6_B);
$(`code:contains(${DIAGRAM_7_A})`).html(DIAGRAM_7_C);
$(`code:contains(${DIAGRAM_7_A})`).html(DIAGRAM_7_B);
$(`code:contains(${DIAGRAM_8_A})`).html(DIAGRAM_8_B);
$(`code:contains(${DIAGRAM_9_A})`).html(DIAGRAM_9_B);
$(`code:contains(${DIAGRAM_10_A})`).html(DIAGRAM_10_B);

Loading…
Cancel
Save