X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/df0aeeeee0378f2d2cdc33cbb38e17c3b8b53bde..95e77cb5590a1499d3aa4cf7fe60481347191c35:/src/black/nodes.py diff --git a/src/black/nodes.py b/src/black/nodes.py index 51d4cb8..7466670 100644 --- a/src/black/nodes.py +++ b/src/black/nodes.py @@ -531,15 +531,14 @@ def first_leaf_column(node: Node) -> Optional[int]: return None -def first_child_is_arith(node: Node) -> bool: - """Whether first child is an arithmetic or a binary arithmetic expression""" - expr_types = { +def is_arith_like(node: LN) -> bool: + """Whether node is an arithmetic or a binary arithmetic expression""" + return node.type in { syms.arith_expr, syms.shift_expr, syms.xor_expr, syms.and_expr, } - return bool(node.children and node.children[0].type in expr_types) def is_docstring(leaf: Leaf) -> bool: