A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-May/064792.html below:

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

[Python-Dev] Any reason that any()/all() do not takea predicateargument? [Python-Dev] Any reason that any()/all() do not takea predicateargument?Andrew Koenig ark at acm.org
Tue May 2 19:55:03 CEST 2006
> > How about this?
> >
> > 	if any(x==5 for x in seq):
> 
> Aren't all of these equivalent to:
> 
> if 5 in seq:
>      ...

Of course.  However, the original example was pretty clearly intended to be
an illustrative instance of a more general problem.  Rewriting the example
as any(x==5 for x in seq) preserves the generality; rewriting it as 5 in seq
doesn't.



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4