diff --git a/README.md b/README.md index bcc7603..367853c 100644 --- a/README.md +++ b/README.md @@ -1276,6 +1276,10 @@ class MySequence: return reversed(self.a) ``` +#### Discrepancies between glossary definitions and abstract base classes: +* **Glossary defines iterable as any object with iter() or getitem() and sequence as any object with len() and getitem(). It does not define collection.** +* **Passing ABC Iterable to isinstance() or issubclass() checks whether object/class has iter(), while ABC Collection checks for iter(), contains() and len().** + ### ABC Sequence * **It's a richer interface than the basic sequence.** * **Extending it generates iter(), contains(), reversed(), index() and count().** diff --git a/index.html b/index.html index 1eb7ca1..40fae20 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
┏━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
+
┏━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
┃ │ Iterable │ Collection │ Sequence │ abc.Sequence ┃
┠────────────┼────────────┼────────────┼────────────┼──────────────┨
┃ iter() │ ! │ ! │ ✓ │ ✓ ┃
@@ -2891,7 +2896,7 @@ $ pyinstaller script.py --add-data '<path>:.'
diff --git a/parse.js b/parse.js
index 16a1fbe..c8a117e 100755
--- a/parse.js
+++ b/parse.js
@@ -486,6 +486,7 @@ function modifyPage() {
highlightCode();
fixPandasDiagram();
removePlotImages();
+ fixABCSequenceDiv();
}
function changeMenu() {
@@ -634,6 +635,10 @@ function removePlotImages() {
$('img[alt="Covid Cases"]').remove();
}
+function fixABCSequenceDiv() {
+ $('#abcsequence').parent().insertBefore($('#tableofrequiredandautomaticallyavailablespecialmethods').parent())
+}
+
function updateDate(template) {
const date = new Date();
const date_str = date.toLocaleString('en-us', {month: 'long', day: 'numeric', year: 'numeric'});