Clarify that the purpose of computing all the miscellaneous collection types is to register them with the appropriate ABCs.

This commit is contained in:
Raymond Hettinger 2012-04-05 13:31:12 -07:00
parent dfe980bb82
commit 02184282c7
1 changed files with 7 additions and 3 deletions

View File

@ -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 = ???