You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did some digging, and this is a parser issue, it tokenizes the same as with the builtin tokenizer module. The error happens while parsing the lambda token, but I couldn’t go further than that with my usual technique since it’s just an error with the generated abstract machine having no valid transition states. I looked at the grammar.txt file, but at least the part about typeparams looks to match what’s in the python docs, so no clue.
This turned out to be a simple fix, I had used the wrong expression kind in the grammar.
It also incorrectly rejects these in TypeVar defaults (new in 3.13), and in addition to lambdas it rejects if ... else, and, or, not, and comparisons (== etc.). Fortunately none of these make semantic sense here.
Describe the bug
The following code can not be parsed/formatted by black:
but it can be parsed by cpython.
Environment
Additional context
The bug was found by pysource-codegen (see #3908)
The text was updated successfully, but these errors were encountered: