[Chicago] Nested List Comprehension in PyDev

Oren Livne livne at uchicago.edu
Mon Oct 15 19:55:02 CEST 2012

Dear All,

If I type this in ipython, I get
In [135]: d = {1: [2,3], 2: [4,5]}

In [136]: [(k, x) for x in d[k] for k in d]
Out[136]: [(1, 4), (2, 4), (1, 5), (2, 5)]

The second command in Eclipse PyDev (using the same python installation) 
says "Undefined variable: k" for the k in the string "d[k]".

What's wrong with PyDev?

More information about the Chicago mailing list