Skip to content

bpo-42381: Allow walrus in set literals and set comprehensions #23332

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

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Nov 16, 2020

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor nit, but other than that LG! 🚀

@pablogsal pablogsal merged commit b0aba1f into python:master Nov 17, 2020
@miss-islington
Copy link
Contributor

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @pablogsal, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker b0aba1fcdc3da952698d99aec2334faa79a8b68c 3.9

pablogsal added a commit to pablogsal/cpython that referenced this pull request Nov 17, 2020
…ythonGH-23332)

Currently walruses are not allowerd in set literals and set comprehensions:

>>> {y := 4, 4**2, 3**3}
  File "<stdin>", line 1
    {y := 4, 4**2, 3**3}
       ^
SyntaxError: invalid syntax

but they should be allowed as well per PEP 572.
(cherry picked from commit b0aba1f)

Co-authored-by: Pablo Galindo <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Nov 17, 2020
@bedevere-bot
Copy link

GH-23333 is a backport of this pull request to the 3.9 branch.

pablogsal added a commit that referenced this pull request Nov 18, 2020
…H-23332) (GH-23333)

Currently walruses are not allowerd in set literals and set comprehensions:

>>> {y := 4, 4**2, 3**3}
  File "<stdin>", line 1
    {y := 4, 4**2, 3**3}
       ^
SyntaxError: invalid syntax

but they should be allowed as well per PEP 572.
(cherry picked from commit b0aba1f)

Co-authored-by: Pablo Galindo <[email protected]>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…nGH-23332)

Currently walruses are not allowerd in set literals and set comprehensions:

>>> {y := 4, 4**2, 3**3}
  File "<stdin>", line 1
    {y := 4, 4**2, 3**3}
       ^
SyntaxError: invalid syntax

but they should be allowed as well per PEP 572
@pablogsal pablogsal deleted the bpo-32381 branch May 19, 2021 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants