-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport set and dict comprehensions #46586
Comments
Dict comprehensions need to be backported. |
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 The patch also adds support for dict and set comprehensions to the Finally, the patch changes the name of the following syntax nodes: |
Alexandre, I can't get this to apply cleanly to my svn trunk checkout |
You need to apply the set literal patch I posted in bpo-2335 first. |
Ah, that works. Thanks! (I'll pay more attention to the tracker |
If there are no objections, I will commit this patch later this week |
Committed in r77422. |
How about fixing set.__repr__ ? |
Great they are backported to 2.7. Dictionary and set comprehensions are not documented in the tutorial of 2.7, though they are in the language reference. Is it OK to add these to the tutorial? I've uploaded a patch. |
Yes, but please create a new issue.
Is it broken? |
I think metal means that the different ways set is repr'd in 2.7 and 3. In 2.7: In [9]: a = {x for x in 'abracadabra' if x not in 'abc'} In [10]: repr(a) In 3.2: In [7]: repr(a) We were saying not changing __repr__ in bpo-2335. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: