Some with statements can not be parsed by black.
They are unlikely to appear in real code, but they are valid python and can be parsed by cpython.
Examples
with (name_2 for name_0 in name_4):
pass
None of these examples have a valid __enter__ or __exit__ and should fail at runtime.
black gives the following error:
error: cannot format example4.py: Cannot parse: 1:8: with a, *b:
Oh no! 💥 💔 💥
1 file failed to reformat.
Expected behavior
black should be able to parse and format this statements.
Environment
python -m black, 23.3.1.dev10+geb32729 (compiled: no)
Python (CPython) 3.11.3
Some with statements can not be parsed by black.
They are unlikely to appear in real code, but they are valid python and can be parsed by cpython.
Examples
None of these examples have a valid
__enter__or__exit__and should fail at runtime.black gives the following error:
Expected behavior
black should be able to parse and format this statements.
Environment
python -m black, 23.3.1.dev10+geb32729 (compiled: no)
Python (CPython) 3.11.3