diff --git a/README.md b/README.md index 5304c53..c5c45e7 100644 --- a/README.md +++ b/README.md @@ -1286,7 +1286,7 @@ class MySequence: ### ABC Sequence * **It's a richer interface than the basic sequence.** * **Extending it generates iter(), contains(), reversed(), index() and count().** -* **Unlike `'abc.Iterable'` and `'abc.Collection'`, it is not a duck type. That is why `'issubclass(MySequence, abc.Sequence)'` would return False even if MySequence had all the methods defined. It however recognizes list, tuple, range, str, bytes, bytearray and memoryview, because they are registered as Sequence's virtual subclasses.** +* **Unlike `'abc.Iterable'` and `'abc.Collection'`, it is not a duck type. That is why `'issubclass(MySequence, abc.Sequence)'` would return False even if MySequence had all the methods defined. It however recognizes list, tuple, range, str, bytes, bytearray, memoryview and deque, because they are registered as Sequence's virtual subclasses.** ```python from collections import abc diff --git a/index.html b/index.html index 42c4be4..69b329b 100644 --- a/index.html +++ b/index.html @@ -1109,7 +1109,7 @@ Hello World!
'abc.Iterable'
and 'abc.Collection'
, it is not a duck type. That is why 'issubclass(MySequence, abc.Sequence)'
would return False even if MySequence had all the methods defined. It however recognizes list, tuple, range, str, bytes, bytearray and memoryview, because they are registered as Sequence's virtual subclasses.'abc.Iterable'
and 'abc.Collection'
, it is not a duck type. That is why 'issubclass(MySequence, abc.Sequence)'
would return False even if MySequence had all the methods defined. It however recognizes list, tuple, range, str, bytes, bytearray, memoryview and deque, because they are registered as Sequence's virtual subclasses.from collections import abc
class MyAbcSequence(abc.Sequence):