We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
with (a,*b): pass
None of these examples have a valid __enter__ or __exit__ and should fail at runtime.
__enter__
__exit__
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
The text was updated successfully, but these errors were encountered:
Presumably related to #2926, and fixable by changing remove_with_parens() in linegen.py.
remove_with_parens()
linegen.py
Sorry, something went wrong.
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: