[Python-Dev] Any reason that any()/all() do not take a predicateargument?

"Martin v. Löwis" martin at v.loewis.de
Sat Apr 15 11:10:32 CEST 2006


Brian Quinlan wrote:
>>> if any(seq, lambda x: x==5):
>> 	if any(x==5 for x in seq):
>> Aren't all of these equivalent to:
>> if 5 in seq:
> ...

There should be one-- and preferably only one --obvious way to do it.
Regards,
Martin


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /