any() and all() shorthand

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

2008/1/7, castironpi at <castironpi at>:
> > 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.

> --

-- Guilherme H. Polo Goncalves

More information about the Python-list mailing list