> > 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.



_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to