[Python-Dev] parsers and compilers for 2.0

Trent Mick trentm@ActiveState.com
Sat, 12 Aug 2000 18:25:18 -0700


On Sat, Aug 12, 2000 at 11:29:14PM +0000, Finn Bock wrote:
> [Thomas Wouters]
> 
> >[(x, y) for y in something for x in somewhere if y in x]
> >
> >The parentheses around the leftmost expression are mandatory. It's currently
> >implemented something like this:
> >
> >L = []
> >__x__ = [].append
> >for y in something:
> >	for x in somewhere:
> >		if y in x:
> >			__x__((x, y))
> >del __x__
> 
> Thank you for the fine example. At least I now think that know what the
> feature is about.
> 

Maybe that example should get in the docs for list comprehensions.


Trent

-- 
Trent Mick
TrentM@ActiveState.com