[New-bugs-announce] [issue18558] Iterables not detected correctly

Stephen Paul Chappell report at bugs.python.org
Fri Jul 26 01:57:31 CEST 2013


New submission from Stephen Paul Chappell:

The following interactive session shows that iterables are not detected properly by the `collections.abc.Iterable` class.

    >>> class IsIterable:
        def __init__(self, data):
            self.data = data
        def __getitem__(self, key):
            return self.data[key]

    >>> is_iterable = IsIterable(range(5))
    >>> for value in is_iterable:
        value

        
    0
    1
    2
    3
    4
    >>> from collections.abc import Iterable
    >>> isinstance(is_iterable, Iterable)
    False

----------
components: Library (Lib)
messages: 193723
nosy: Zero
priority: normal
severity: normal
status: open
title: Iterables not detected correctly
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18558>
_______________________________________


More information about the New-bugs-announce mailing list