This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yoch.melka
Recipients yoch.melka
Date 2015-10-29.19:38:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1446147504.48.0.238943227833.issue25513@psf.upfronthosting.co.za>
In-reply-to
Content
collections.abc.Iterable don't implement the __bool__ method. This may seriously degrade performance in case __len__ is not efficient.

I suggest to implement it as :

class Iterable:
    ...
    def __bool__(self):
        try:
            next(iter(self))
            return True
        except StopIteration:
            return False
History
Date User Action Args
2015-10-29 19:38:24yoch.melkasetrecipients: + yoch.melka
2015-10-29 19:38:24yoch.melkasetmessageid: <1446147504.48.0.238943227833.issue25513@psf.upfronthosting.co.za>
2015-10-29 19:38:24yoch.melkalinkissue25513 messages
2015-10-29 19:38:24yoch.melkacreate