Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Jan 28, 2022
1 parent 16cbced commit ae71c47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/black/linegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def visit_suite(self, node: Node) -> Iterator[Line]:

def visit_simple_stmt(self, node: Node) -> Iterator[Line]:
"""Visit a statement without nested statements."""
prev_type = None
prev_type: Optional[int] = None
for child in node.children:
if (prev_type is None or prev_type == token.SEMI) and is_arith_like(child):
wrap_in_parentheses(node, child, visible=False)
Expand Down
2 changes: 1 addition & 1 deletion src/black/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def first_leaf_column(node: Node) -> Optional[int]:
return None


def is_arith_like(node: Node) -> bool:
def is_arith_like(node: LN) -> bool:
"""Whether node is an arithmetic or a binary arithmetic expression"""
return node.type in {
syms.arith_expr,
Expand Down

0 comments on commit ae71c47

Please sign in to comment.