This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alexandre.vassalotti
Recipients alexandre.vassalotti, brett.cannon
Date 2009-08-05.23:09:59
SpamBayes Score 1.81662e-05
Marked as misclassified No
Message-id <>
Here is a patch to backport dict and set comprehensions to the trunk.

The patch preserves the Python 3.x's syntax and semantics of the
feature. Although this makes dict and set comprehensions is inconsistent
with list comprehension, I believe this is reasonable since the backport
aimed to improve the compatibility of Python 2.x with Python 3.x.

The patch also adds support for dict and set comprehensions to the
'compiler' package. However, the support is quirky and use the list
comprehension semantics of Python 2.x. This allowed me to keep the patch
simple and to keep myself sane ;-).

Finally, the patch changes the name of the following syntax nodes:
'gen_expr', 'gen_iter', 'gen_if', and 'testlist_gexp'. I don't know if
we have compatibility requirements for this; so I don't know if this is
an issue.
Date User Action Args
2009-08-05 23:10:13alexandre.vassalottisetrecipients: + alexandre.vassalotti, brett.cannon
2009-08-05 23:10:13alexandre.vassalottisetmessageid: <>
2009-08-05 23:10:11alexandre.vassalottilinkissue2333 messages
2009-08-05 23:10:11alexandre.vassalotticreate