(test) ? a:b

Vito De Tullio vito.detullio at gmail.com
Thu Oct 23 06:55:22 CEST 2014


Dennis Lee Bieber wrote:

>> x = [f(), g()] [cond]
>>
>>the latter evaluates both f() and g() instead of just one. Apart from
>>being inefficient, it can have unintended side-effects.
> 
> Ah, but what would
> 
> x = [f, g][cond]()
> 
> produce?


headache

-- 
By ZeD




More information about the Python-list mailing list