Visitar URL original
[3.7] bpo-36541: lib2to3: Support named assignment expressions (GH-12702) by thatch · Pull Request #19317 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20220609035537/https://github.com/python/cpython/pull/19317
Skip to content
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

[3.7] bpo-36541: lib2to3: Support named assignment expressions (GH-12702) #19317

Merged
merged 2 commits into from Apr 3, 2020

Conversation

thatch
Copy link
Contributor

@thatch thatch commented Apr 2, 2020 •

There are two copies of the grammar -- the one used by Python itself as
Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at
Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it
to be reasonable stable to avoid requiring fixer rewrites.

This brings suport for syntax like if x:= foo(): to match what the live
Python grammar does.

This should've been added at the time of the walrus operator itself, but lib2to3 being
independent is often overlooked. So we do consider this a bugfix rather than enhancement.
(cherry picked from commit 3c3aa45)

Co-authored-by: Tim Hatch tim@timhatch.com

https://bugs.python.org/issue36541

https://bugs.python.org/issue36541

gpshead
gpshead approved these changes Apr 3, 2020
Copy link
Member

@gpshead gpshead left a comment

the CI seems to show test_lib2to3 failing?

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Apr 3, 2020

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be poked with soft cushions!

Lib/lib2to3/tests/test_parser.py Outdated Show resolved Hide resolved
thatch added 2 commits Apr 3, 2020
There are two copies of the grammar -- the one used by Python itself as
Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at
Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it
to be reasonable stable to avoid requiring fixer rewrites.

This brings suport for syntax like `if x:= foo():` to match what the live
Python grammar does.

This should've been added at the time of the walrus operator itself, but lib2to3 being
independent is often overlooked.  So we do consider this a bugfix rather than enhancement.

(cherry picked from commit 3c3aa45)
There are two copies of the grammar -- the one used by Python itself as
Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at
Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it
to be reasonable stable to avoid requiring fixer rewrites.

This brings suport for syntax like `if x:= foo():` to match what the live
Python grammar does.

This should've been added at the time of the walrus operator itself, but lib2to3 being
independent is often overlooked.  So we do consider this a bugfix rather than enhancement..
(cherry picked from commit 3c3aa45)

Co-authored-by: Tim Hatch <tim@timhatch.com>
@thatch thatch force-pushed the backport-3c3aa45-3.7 branch from bd02845 to c6a0691 Compare Apr 3, 2020
@thatch
Copy link
Contributor Author

@thatch thatch commented Apr 3, 2020

I have made the requested changes; please review again

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Apr 3, 2020

Thanks for making the requested changes!

@gpshead: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from gpshead Apr 3, 2020
@gpshead gpshead merged commit 96c5f5a into python:3.7 Apr 3, 2020
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA signed type-bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants