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 wim.glenn
Recipients wim.glenn
Date 2013-02-20.12:32:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361363523.21.0.389382040162.issue17255@psf.upfronthosting.co.za>
In-reply-to
Content
The docs http://docs.python.org/2/library/functions.html#all provide some equivalent code for all builtin (and similarly for any):

def all(iterable):
    for element in iterable:
        if not element:
            return False
    return True

The behaviour is clearly documented as short-circuiting, but the cases contained in test_builtin.py are lacking any test coverage for the short-circuiting behaviour.  You could implement any/all in a broken way that still passes the current tests (consuming more of a generator than you want to for example), so it is important to guarantee the short-circuiting.

My patch adds two simple test cases to make this behaviour explicit.
History
Date User Action Args
2013-02-20 12:32:03wim.glennsetrecipients: + wim.glenn
2013-02-20 12:32:03wim.glennsetmessageid: <1361363523.21.0.389382040162.issue17255@psf.upfronthosting.co.za>
2013-02-20 12:32:03wim.glennlinkissue17255 messages
2013-02-20 12:32:02wim.glenncreate