any() and all() shorthand

Guilherme Polo ggpolo at gmail.com
Mon Jan 7 20:29:03 CET 2008


2008/1/7, castironpi at gmail.com <castironpi at gmail.com>:
> > You are too late, any and all are built-in into python 2.5
>
> Hi, excellent.  Now how about something more generic, possibly:
>
> [ x.y() for x or _next_ in c ]
>
> where the context of _next_ is limited in complexity, and/or can only
> occur in a generator?

Would you care to explain what that syntax supposedly means ? By
_next_ you mean something like the next method in generators ? _next_
executes if x is false ? so whatever _next_ returns is named as x, so
you can call x.y() ? I really didn't get your new syntax inside that
list comprehension, neither its uses.

> --
> http://mail.python.org/mailman/listinfo/python-list
>


-- 
-- Guilherme H. Polo Goncalves



More information about the Python-list mailing list