-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
bpo-36541: Add lib2to3 grammar PEP-570 pos-only arg parsing #23759
bpo-36541: Add lib2to3 grammar PEP-570 pos-only arg parsing #23759
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I left a minor comment
Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
…-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 <[email protected]>
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. |
…-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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
|
…-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.
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