[Python-Dev] Any reason that any()/all() do not take a predicateargument? (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Sat Apr 15 11:10:32 CEST 2006
- Previous message: [Python-Dev] Any reason that any()/all() do not take a predicateargument?
- Next message: [Python-Dev] Any reason that any()/all() do not take a predicateargument?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] Any reason that any()/all() do not take a predicateargument?
- Next message: [Python-Dev] Any reason that any()/all() do not take a predicateargument?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]