builtin functions for and and or?

Brian Beck exogen at gmail.com
Sun Feb 13 17:19:31 EST 2005


Steven Bethard wrote:
> Another alternative:
> 
> not False in (bool(x) for x in L)
> 
> Note that this should short-circuit, where min won't.
> 
> Steve

Whoops, for some reason the thought that short-circuiting didn't apply 
to And entered my mind while trying to post a nice solution. Hard to say 
why considering I have to do stuff like this on a daily basis!

Ignore mine except as a novelty, then.

--
Brian Beck
Adventurer of the First Order



More information about the Python-list mailing list