FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.7] bpo-36541: lib2to3: Support named assignment expressions (GH-12702) by thatch · Pull Request #19317 · python/cpython · GitHub

Repository navigation

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

Merged
gpshead merged 2 commits into
python:3.7from
thatch:backport-3c3aa45-3.7
Apr 3, 2020
Merged

gpshead merged 2 commits into
python:3.7from
thatch:backport-3c3aa45-3.7

Conversation

thatch commented Apr 2, 2020 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

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 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

the CI seems to show test_lib2to3 failing?

Copy link
Copy Markdown

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!

Comment thread Lib/lib2to3/tests/test_parser.py Outdated
thatch added 2 commits April 3, 2020 07:09
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 force-pushed the backport-3c3aa45-3.7 branch from bd02845 to c6a0691 Compare April 3, 2020 14:11

thatch commented Apr 3, 2020

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

Copy link
Copy Markdown

Thanks for making the requested changes!

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

bedevere-bot requested a review from gpshead April 3, 2020 14:38
gpshead merged commit 96c5f5a into python:3.7 Apr 3, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL