-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
C: parserHow we parse code. Or fail to parse it.How we parse code. Or fail to parse it.T: bugSomething isn't workingSomething isn't working
Description
Describe the bug
The following code can not be parsed/formatted by black:
class name_5[name_4: lambda: something]:
pass❯ black -t py312 bug.py
error: cannot format bug.py: Cannot parse for target version Python 3.12: 1:21: class name_5[name_4: lambda: something]:
Oh no! 💥 💔 💥
1 file failed to reformat.
but it can be parsed by cpython.
python3.12 scripts/min_code.py
Environment
- Black's version: current main (00c0d6d)
- OS and Python version: Linux/Python 3.12
Additional context
The bug was found by pysource-codegen (see #3908)
Metadata
Metadata
Assignees
Labels
C: parserHow we parse code. Or fail to parse it.How we parse code. Or fail to parse it.T: bugSomething isn't workingSomething isn't working