diff --git a/README.md b/README.md index e1cd5d6..ef227d3 100644 --- a/README.md +++ b/README.md @@ -1046,6 +1046,13 @@ class MyCollection: yield el ``` +```python +>>> from collections.abc import Sequence, Collection, Iterable +>>> a = MyCollection([1, 2, 3]) +>>> isinstance(a, Sequence), isinstance(a, Collection), isinstance(a, Iterable) +(False, True, True) +``` + ### Iterator ```python class Counter: diff --git a/index.html b/index.html index bc6664b..5ba62ac 100644 --- a/index.html +++ b/index.html @@ -981,6 +981,11 @@ creature = Creature(Point(0, for el in self.a: yield el +
>>> from collections.abc import Sequence, Collection, Iterable
+>>> a = MyCollection([1, 2, 3])
+>>> isinstance(a, Sequence), isinstance(a, Collection), isinstance(a, Iterable)
+(False, True, True)
+

Iterator

class Counter:
     def __init__(self):