Raymond Hettinger wrote:
> Besides, for the "gurus who are in the know", the min() and max()
> functions can often be substituted directly for any() and all()
> and then you get the key= syntax for free ;-)
> 
>    any(x%2==0 for x in s)
>    max(x%2==0 for x in s)

Except that you lose the short-circuiting behaviour by using the latter 
form.

Anyway, for some reason the whole 'these work really well with generator 
expressions' aspect of any/all completely slipped my mind when I asked 
that question about a key argument. Sorry for the pointless noise...

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to