py3k dictionary/set comprehensions not supported
Brought to you by:
fabioz
This is legal python 3.0 code:
s = {1, 2, 3}
print(s)
s = {x + 1 for x in s} # pydev reports error here
print(s)
s = {x : x * 2 for x in s} # pydev reports error here
print(s)
However, pydev 1.4.2 (on eclipse ganymede/winXP, with pydev extension) doesn't recoginize this syntax, reporting various meaningless errors from 'undeclared variable x' to 'Encountered "for" at bla bla, was expecting [lots of stuff]'.
There is no separate PEPs on this features, refer to http://docs.python.org/3.0/reference/expressions.html#set-displays and around.
Reminders:
It just doesn't support
{x + 1 for x in s}
If that construct is removed, the parsing works -- and it works as {x for x in s}, so, apparently it's not supporting the correct construct as the 1st part of the set comprehension.
Fixed for 1.4.3 (svn: 2497)