commit | ead22227cce112457b6beba8b008699ea4a3a084 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Mon Nov 29 03:56:12 2010 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Mon Nov 29 03:56:12 2010 +0000 |
tree | 9dcc912a990ce6e6730f52e71d431ac489eb7b70 | |
parent | 263cbdfdfb0a7fe13f04c1b3188968d7a39d7d09 [diff] [blame] |
Issue #10565: Iterator ABC should require both __next__ and __iter__.
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index cac06e0..0957553 100644 --- a/Lib/_abcoll.py +++ b/Lib/_abcoll.py
@@ -90,7 +90,8 @@ @classmethod def __subclasshook__(cls, C): if cls is Iterator: - if any("__next__" in B.__dict__ for B in C.__mro__): + if (any("__next__" in B.__dict__ for B in C.__mro__) and + any("__iter__" in B.__dict__ for B in C.__mro__)): return True return NotImplemented