Skip to content

Commit 31d0d26

Browse files
committed
Minor rename for clarity
1 parent 3370b68 commit 31d0d26

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Diff for: src/black/linegen.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def visit_funcdef(self, node: Node) -> Iterator[Line]:
190190
if maybe_make_parens_invisible_in_atom(
191191
child,
192192
parent=node,
193-
remove_brackets_around_comma=False,
193+
remove_parens_around_comma=False,
194194
):
195195
wrap_in_parentheses(node, child, visible=False)
196196
else:
@@ -1011,7 +1011,7 @@ def remove_await_parens(node: Node) -> None:
10111011
if maybe_make_parens_invisible_in_atom(
10121012
node.children[1],
10131013
parent=node,
1014-
remove_brackets_around_comma=True,
1014+
remove_parens_around_comma=True,
10151015
):
10161016
wrap_in_parentheses(node, node.children[1], visible=False)
10171017

@@ -1046,7 +1046,7 @@ def remove_for_target_parens(node: Node, parent: Node) -> None:
10461046
# Parenthesized group of nodes/leaves, eg. `(x, y)`
10471047
# First try removing the group's surrounding parentheses.
10481048
if maybe_make_parens_invisible_in_atom(
1049-
node, parent, remove_brackets_around_comma=(parent.type == syms.for_stmt)
1049+
node, parent, remove_parens_around_comma=(parent.type == syms.for_stmt)
10501050
):
10511051
wrap_in_parentheses(parent, node, visible=False)
10521052
# Then check if this atom could contain more atoms.
@@ -1082,7 +1082,7 @@ def remove_with_parens(node: Node, parent: Node) -> None:
10821082
if maybe_make_parens_invisible_in_atom(
10831083
node,
10841084
parent=parent,
1085-
remove_brackets_around_comma=True,
1085+
remove_parens_around_comma=True,
10861086
):
10871087
wrap_in_parentheses(parent, node, visible=False)
10881088
if isinstance(node.children[1], Node):
@@ -1097,15 +1097,16 @@ def remove_with_parens(node: Node, parent: Node) -> None:
10971097
if maybe_make_parens_invisible_in_atom(
10981098
node.children[0],
10991099
parent=node,
1100-
remove_brackets_around_comma=True,
1100+
remove_parens_around_comma=True,
11011101
):
11021102
wrap_in_parentheses(node, node.children[0], visible=False)
11031103

11041104

11051105
def maybe_make_parens_invisible_in_atom(
11061106
node: LN,
11071107
parent: LN,
1108-
remove_brackets_around_comma: bool = False,
1108+
*,
1109+
remove_parens_around_comma: bool = False,
11091110
) -> bool:
11101111
"""If it's safe, make the parens in the atom `node` invisible, recursively.
11111112
Additionally, remove repeated, adjacent invisible parens from the atom `node`
@@ -1119,10 +1120,10 @@ def maybe_make_parens_invisible_in_atom(
11191120
or is_one_tuple(node)
11201121
or (is_yield(node) and parent.type != syms.expr_stmt)
11211122
or (
1122-
# This condition tries to prevent removing non-optional brackets
1123+
# This condition tries to prevent removing non-optional parentheses
11231124
# around a tuple, however, can be a bit overzealous so we provide
11241125
# and option to skip this check for `for` and `with` statements.
1125-
not remove_brackets_around_comma
1126+
not remove_parens_around_comma
11261127
and max_delimiter_priority_in_atom(node) >= COMMA_PRIORITY
11271128
)
11281129
):
@@ -1150,7 +1151,7 @@ def maybe_make_parens_invisible_in_atom(
11501151
maybe_make_parens_invisible_in_atom(
11511152
middle,
11521153
parent=parent,
1153-
remove_brackets_around_comma=remove_brackets_around_comma,
1154+
remove_parens_around_comma=remove_parens_around_comma,
11541155
)
11551156

11561157
if is_atom_with_invisible_parens(middle):

0 commit comments

Comments
 (0)