[Python-checkins] cpython: Clarify that the purpose of computing all the miscellaneous collection types is

raymond.hettinger python-checkins at python.org
Thu Apr 5 22:31:29 CEST 2012


http://hg.python.org/cpython/rev/67c26185636b
changeset:   76127:67c26185636b
user:        Raymond Hettinger <python at rcn.com>
date:        Thu Apr 05 13:31:12 2012 -0700
summary:
  Clarify that the purpose of computing all the miscellaneous collection types is to register them with the appropriate ABCs.

files:
  Lib/collections/abc.py |  10 +++++++---
  1 files changed, 7 insertions(+), 3 deletions(-)


diff --git a/Lib/collections/abc.py b/Lib/collections/abc.py
--- a/Lib/collections/abc.py
+++ b/Lib/collections/abc.py
@@ -18,9 +18,13 @@
            "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 = ???

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list