diff options
author | Raymond Hettinger <python@rcn.com> | 2012-04-05 20:31:12 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2012-04-05 20:31:12 (GMT) |
commit | 02184282c7b6f68f905a08670b93862662bf4397 (patch) | |
tree | 57e15b5970aa5fe5f6b374a2768ca32d94c92d77 /Lib/collections | |
parent | dfe980bb82f52f95d60297e3840a4e6708baa147 (diff) | |
download | cpython-02184282c7b6f68f905a08670b93862662bf4397.zip cpython-02184282c7b6f68f905a08670b93862662bf4397.tar.gz cpython-02184282c7b6f68f905a08670b93862662bf4397.tar.bz2 |
Clarify that the purpose of computing all the miscellaneous collection types is to register them with the appropriate ABCs.
Diffstat (limited to 'Lib/collections')
-rw-r--r-- | Lib/collections/abc.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/collections/abc.py b/Lib/collections/abc.py index 7fbe84d..37a813a 100644 --- a/Lib/collections/abc.py +++ b/Lib/collections/abc.py @@ -18,9 +18,13 @@ __all__ = ["Hashable", "Iterable", "Iterator", "ByteString", ] - -### collection related types which are not exposed through builtin ### -## iterators ## +# Private list of types that we want to register with the various ABCs +# so that they will pass tests like: +# it = iter(somebytearray) +# assert isinstance(it, Iterable) +# Note: in other implementations, these types many not be distinct +# and they make have their own implementation specific types that +# are not included on this list. bytes_iterator = type(iter(b'')) bytearray_iterator = type(iter(bytearray())) #callable_iterator = ??? |