mirror of
https://github.com/python/cpython.git
synced 2025-08-15 14:20:55 +00:00
Merged revisions 86857 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86857 | raymond.hettinger | 2010-11-28 22:56:12 -0500 (Sun, 28 Nov 2010) | 1 line Issue #10565: Iterator ABC should require both __next__ and __iter__. ........
This commit is contained in:
parent
30ec1154ac
commit
1fea5c4472
3 changed files with 17 additions and 3 deletions
|
@ -82,7 +82,7 @@ class Iterator(Iterable):
|
|||
@classmethod
|
||||
def __subclasshook__(cls, C):
|
||||
if cls is Iterator:
|
||||
if _hasattr(C, "next"):
|
||||
if _hasattr(C, "next") and _hasattr(C, "__iter__"):
|
||||
return True
|
||||
return NotImplemented
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue