Take a look at org.python.compiler.CodeCompiler#visitListComp and the corresponding rule in Python.g.

On Sun, May 31, 2009 at 8:01 AM, Yin Wang <yinwang0@gmail.com> wrote:

I wonder whether there is a visitor for comprehension? I can't descend
into comprehensions without it.

I can find almost all other visitors in VisitorIF except the one for
comprehension. I only found visitGeneratorExp in the code compiler, so
I began to wonder whether comprehension is going to be used any more.
But I did have a program parsed by BaseParser into a ListComp
containing a comprehension in the generator field.

print [[x,x**2] for x in [1,2,3]]

Any ideas?

-- yin

Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
Jython-dev mailing list

Jim Baker