[Python-ideas] Parametrized any() and all() ?

Nick Coghlan ncoghlan at gmail.com
Wed Jan 16 12:10:00 CET 2013


On Wed, Jan 16, 2013 at 8:44 PM, Tarek Ziadé <tarek at ziade.org> wrote:
> On 1/16/13 11:33 AM, Laurens Van Houtven wrote:
>>
>> Hey Tarek,
>>
>> I would write that as any(x is None for x in it)
>
>
> But here you're building yet another iterable to adapt it to any(), which
> seems to me overkill if we can just parametrized the loop in any()

Such a micro-optimization isn't worth the cost of adding a second way
to do it that everyone will then need to learn.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list