[issue10565] isinstance(x, collections.Iterator) can return True, when x isn't iterable

2010-11-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in r86872 (3.1) and r86873 (2.7). -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker

[issue10565] isinstance(x, collections.Iterator) can return True, when x isn't iterable

2010-11-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: ok -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue10565] isinstance(x, collections.Iterator) can return True, when x isn't iterable

2010-11-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Alexander, do you want to take care of the backport? -- assignee: rhettinger -> belopolsky nosy: +belopolsky ___ Python tracker ___

[issue10565] isinstance(x, collections.Iterator) can return True, when x isn't iterable

2010-11-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed in r86857. Needs backport. -- versions: +Python 2.7 ___ Python tracker ___ ___ Python-bugs

[issue10565] isinstance(x, collections.Iterator) can return True, when x isn't iterable

2010-11-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: > A possible solution could be in > collections.Iterator.__subclasshook__ > checking for both required methods. That makes sense. PEP 234 requires iterators to support both methods. -- assignee: -> rhettinger ___

[issue10565] isinstance(x, collections.Iterator) can return True, when x isn't iterable

2010-11-28 Thread Daniel Urban
New submission from Daniel Urban : If the type of x defines __next__, but not __iter__, isinstance(x, collections.Iterator) returns True, but in fact x isn't iterable. >>> class X: ... def __next__(self): ... raise StopIteration() ... >>> x = X() >>> isinstance(x, collections.It