[docs] [issue18558] Iterable glossary entry needs clarification

Stephen Paul Chappell report at bugs.python.org
Thu Aug 1 21:05:24 CEST 2013


Stephen Paul Chappell added the comment:

If my program needed to know if an object is iterable, it would be tempting to define and call the following function instead of using collections.abc.Iterable:

    def iterable(obj):
        try:
            iter(obj)
        except TypeError:
            return False
        return True

Something tells me that is not what the author of collections.abc.Iterable intended.

----------

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


More information about the docs mailing list