bpo-36541: Add lib2to3 grammar PEP-570 pos-only arg parsing#23759
Merged
gpshead merged 4 commits intopython:masterfrom Dec 14, 2020
Merged
bpo-36541: Add lib2to3 grammar PEP-570 pos-only arg parsing#23759gpshead merged 4 commits intopython:masterfrom
gpshead merged 4 commits intopython:masterfrom
Conversation
This adds 3.8's PEP-570 support to lib2to3's pgen2. lib2to3, while being deprecated is still used by things to parse all versions of Python code today. We need it to support parsing modern 3.8 and 3.9 constructs.
pablogsal
reviewed
Dec 14, 2020
pablogsal
approved these changes
Dec 14, 2020
Member
pablogsal
left a comment
There was a problem hiding this comment.
LGTM
I left a minor comment
Contributor
|
Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Dec 14, 2020
…-23759) Add positional only args support to lib2to3 pgen2. This adds 3.8's PEP-570 support to lib2to3's pgen2. lib2to3, while being deprecated is still used by things to parse all versions of Python code today. We need it to support parsing modern 3.8 and 3.9 constructs. Also add tests for complex *expr and **expr's. (cherry picked from commit 42c9f0f) Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
GH-23768 is a backport of this pull request to the 3.9 branch. |
|
GH-23769 is a backport of this pull request to the 3.8 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Dec 14, 2020
…-23759) Add positional only args support to lib2to3 pgen2. This adds 3.8's PEP-570 support to lib2to3's pgen2. lib2to3, while being deprecated is still used by things to parse all versions of Python code today. We need it to support parsing modern 3.8 and 3.9 constructs. Also add tests for complex *expr and **expr's. (cherry picked from commit 42c9f0f) Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington
added a commit
that referenced
this pull request
Dec 14, 2020
Add positional only args support to lib2to3 pgen2. This adds 3.8's PEP-570 support to lib2to3's pgen2. lib2to3, while being deprecated is still used by things to parse all versions of Python code today. We need it to support parsing modern 3.8 and 3.9 constructs. Also add tests for complex *expr and **expr's. (cherry picked from commit 42c9f0f) Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington
added a commit
that referenced
this pull request
Dec 14, 2020
Add positional only args support to lib2to3 pgen2. This adds 3.8's PEP-570 support to lib2to3's pgen2. lib2to3, while being deprecated is still used by things to parse all versions of Python code today. We need it to support parsing modern 3.8 and 3.9 constructs. Also add tests for complex *expr and **expr's. (cherry picked from commit 42c9f0f) Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
adorilson
pushed a commit
to adorilson/cpython
that referenced
this pull request
Mar 13, 2021
…-23759) Add positional only args support to lib2to3 pgen2. This adds 3.8's PEP-570 support to lib2to3's pgen2. lib2to3, while being deprecated is still used by things to parse all versions of Python code today. We need it to support parsing modern 3.8 and 3.9 constructs. Also add tests for complex *expr and **expr's.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lib2to3 is effectively EOL, but it was never taught to parse positional only args ala PEP-570 that shipped in 3.8. This fixes that oversight.
Even though destined to wind up on PyPI instead of in the stdlib, this should help give it a proper sendoff and unblock things still using it under 3.8.x and 3.9.x from falling over on modern syntax.
Notably the blib2to3 within Black already backported these https://github.com/python/cpython/blob/3.8/Grammar/Grammar updates.
https://bugs.python.org/issue36541