ruff
ruff copied to clipboard
Parenthesized context managers raise E999
Ruff version: 0.0.132 Ruff configuration: Default
Ruff reports E999 (Syntax Error) for parenthesized context managers that were introduced in python 3.10
This raises E999
test.py:2:15: E999 SyntaxError: invalid syntax. Got unexpected token 'as'
with (
open("") as a,
open("") as b,
):
pass
However it works fine if you use \ to split line:
with open("") as a, \
open("") as b:
pass
Related #54, #286
👍 Unfortunately a known problem that I need to invest in resolving :) Same for structural pattern matching.
Np, just made an issue so it's documented and is easier to find ❤️
Always appreciated!
Marking as a duplicate of #54.