Message182496
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. |
|
Date |
User |
Action |
Args |
2013-02-20 12:32:03 | wim.glenn | set | recipients:
+ wim.glenn |
2013-02-20 12:32:03 | wim.glenn | set | messageid: <1361363523.21.0.389382040162.issue17255@psf.upfronthosting.co.za> |
2013-02-20 12:32:03 | wim.glenn | link | issue17255 messages |
2013-02-20 12:32:02 | wim.glenn | create | |
|