Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington 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

Automerge-Triggered-By: @gpshead

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>
@bedevere-bot bedevere-bot added type-bug An unexpected behavior, bug, or error awaiting review labels Apr 2, 2020
@gpshead gpshead changed the title [3.8] lib2to3: Support named assignment expressions (GH-12702) [3.8] bpo-36541: lib2to3: Support named assignment expressions (GH-12702) Apr 2, 2020
@miss-islington
Copy link
Contributor Author

@thatch and @gpshead: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 1098671 into python:3.8 Apr 2, 2020
@miss-islington miss-islington deleted the backport-3c3aa45-3.8 branch April 2, 2020 23:03
@miss-islington
Copy link
Contributor Author

@thatch and @gpshead: Status check is done, and it's a success ✅ .

1 similar comment
@miss-islington
Copy link
Contributor Author

@thatch and @gpshead: Status check is done, and it's a success ✅ .

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.

5 participants