feature request: a better str.endswith

Bengt Richter bokr at oz.net
Wed Jul 23 05:14:29 EDT 2003


On Wed, 23 Jul 2003 08:06:17 +0000 (UTC), Duncan Booth <duncan at NOSPAMrcp.co.uk> wrote:

>bokr at oz.net (Bengt Richter) wrote in news:bfjokm$kbc$0 at 216.39.172.122:
>
>>>'all_false(...)' is simply 'not any_true(...)'
>>>'any_false(...)' is 'not all_true(...)'
>>>
>>>So you could get by with just two of these functions, in which case 
>>>'any_of', and 'all_of' might be suitable names.
>>>
>> I don't think they're equivalent if they do short-circuiting.
>> 
>
>any_true short circuits as soon as it finds one that is true.
>all_false short circuits as soon as it find one that is true.
>
>all_true short circuits as soon as it finds on that is false.
>any_false ditto.
>
>Why aren't they equivalent?
>
Oops, d'oh ... well, they're not spelled the same ;-)

Regards,
Bengt Richter




More information about the Python-list mailing list