Browse Source

Duck types

pull/36/head
Jure Šorn 5 years ago
parent
commit
b9b503a23c
4 changed files with 8 additions and 8 deletions
  1. 4
      README.md
  2. 4
      index.html
  3. 4
      parse.js
  4. 4
      web/script_2.js

4
README.md

@ -1138,10 +1138,10 @@ class MyAbcSequence(collections.abc.Sequence):
return self.a[i]
```
#### Table of provided methods:
#### Table of the methods that each (duck) type provides:
```text
+------------+----------+------------+----------+--------------+
| | iterable | collection | sequence | abc.Sequence |
| | Iterable | Collection | Sequence | abc.Sequence |
+------------+----------+------------+----------+--------------+
| iter() | yes | yes | yes | yes |
| len() | | yes | yes | yes |

4
index.html

@ -1070,9 +1070,9 @@ Z = dataclasses.make_dataclass(<span class="hljs-string">'Z'</span>, [<span clas
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__getitem__</span><span class="hljs-params">(self, i)</span>:</span>
<span class="hljs-keyword">return</span> self.a[i]
</code></pre>
<h4 id="tableofprovidedmethods">Table of provided methods:</h4>
<h4 id="tableofthemethodsthateachducktypeprovides">Table of the methods that each (duck) type provides:</h4>
<pre><code class="text language-text">┏━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━┓
┃ │ iterable │ collection │ sequence │ abc.Sequence ┃
┃ │ Iterable │ Collection │ Sequence │ abc.Sequence ┃
┠────────────┼──────────┼────────────┼──────────┼──────────────┨
┃ iter() │ ✓ │ ✓ │ ✓ │ ✓ ┃
┃ len() │ │ ✓ │ ✓ │ ✓ ┃

4
parse.js

@ -142,7 +142,7 @@ const DIAGRAM_5_B =
const DIAGRAM_6_A =
'+------------+----------+------------+----------+--------------+\n' +
'| | iterable | collection | sequence | abc.Sequence |\n' +
'| | Iterable | Collection | Sequence | abc.Sequence |\n' +
'+------------+----------+------------+----------+--------------+\n' +
'| iter() | yes | yes | yes | yes |\n' +
'| len() | | yes | yes | yes |\n' +
@ -152,7 +152,7 @@ const DIAGRAM_6_A =
const DIAGRAM_6_B =
'┏━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━┓\n' +
'┃ │ iterable │ collection │ sequence │ abc.Sequence ┃\n' +
'┃ │ Iterable │ Collection │ Sequence │ abc.Sequence ┃\n' +
'┠────────────┼──────────┼────────────┼──────────┼──────────────┨\n' +
'┃ iter() │ ✓ │ ✓ │ ✓ │ ✓ ┃\n' +
'┃ len() │ │ ✓ │ ✓ │ ✓ ┃\n' +

4
web/script_2.js

@ -110,7 +110,7 @@ const DIAGRAM_5_B =
const DIAGRAM_6_A =
'+------------+----------+------------+----------+--------------+\n' +
'| | iterable | collection | sequence | abc.Sequence |\n' +
'| | Iterable | Collection | Sequence | abc.Sequence |\n' +
'+------------+----------+------------+----------+--------------+\n' +
'| iter() | yes | yes | yes | yes |\n' +
'| len() | | yes | yes | yes |\n' +
@ -120,7 +120,7 @@ const DIAGRAM_6_A =
const DIAGRAM_6_B =
'┏━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━┓\n' +
'┃ │ iterable │ collection │ sequence │ abc.Sequence ┃\n' +
'┃ │ Iterable │ Collection │ Sequence │ abc.Sequence ┃\n' +
'┠────────────┼──────────┼────────────┼──────────┼──────────────┨\n' +
'┃ iter() │ ✓ │ ✓ │ ✓ │ ✓ ┃\n' +
'┃ len() │ │ ✓ │ ✓ │ ✓ ┃\n' +

Loading…
Cancel
Save