-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
F: parenthesesToo many parentheses, not enough parentheses, and so on.Too many parentheses, not enough parentheses, and so on.S: acceptedThe changes in this design / enhancement issue have been accepted and can be implementedThe changes in this design / enhancement issue have been accepted and can be implementedT: bugSomething isn't workingSomething isn't working
Description
Describe the bug
Black removes redundant parenthesis in most contexts, but this does not apply to the with statement yet.
To Reproduce
Playground link
if (open("bla.txt")):
pass
with (open("bla.txt")):
passOutput:
if open("bla.txt"): # <-- parenthesis removed
pass
with (open("bla.txt")): # <-- parenthesis retained
passAdding --target-version=py310 or --preview does not change this behavior.
Environment
- Black's version: 22.1.0 and main branch
- OS and Python version: Python 3.10
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
F: parenthesesToo many parentheses, not enough parentheses, and so on.Too many parentheses, not enough parentheses, and so on.S: acceptedThe changes in this design / enhancement issue have been accepted and can be implementedThe changes in this design / enhancement issue have been accepted and can be implementedT: bugSomething isn't workingSomething isn't working