-
Notifications
You must be signed in to change notification settings - Fork 895
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
match case statement raise lib2to3.pgen2.parse.ParseError: bad input. Using yapf 0.32.0 #1045
Comments
It's a bit surprising that yapf still doesn't support a language feature that was introduced over a year ago. Hopefully char101's fork can be merged in soon. |
Really. Hope so too. |
Yapf would require significant work to switch to using the new Python parser, which is what's required to handle "match". See also Issue #993 |
sad(( |
Maybe someone will volunteer to do this work ... |
Not true. Black supports all Python 3.10 syntax. |
While black and yapf continue to rely on lib2to3 it seems reasonable to use black's patched verion in yapf, either via a manual export like @char101 has done or to approach the black team about exporting blib2to3 to an external package that both black and yapf use as requirements. @thiagowfx and others, thoughts on one of these approaches? |
Opened #1067 for discussion. |
Hi.
Using Python3.10 match case raise exception.
Version: yapf-0.32.0
This guy said the problem is in:
"
Apparently this is just the consequence of python moving to a PEG parser and the parser used in lib2to3 cannot parse PEG grammar.
" here: #966 (comment)
And he already solve this problem here:
https://github.com/char101/yapf/commits/3.10
But it will be cool to have official solution. bcs in our team we use it locally.
The text was updated successfully, but these errors were encountered: