MCPcopy
hub / github.com/psf/black / is_simple

Function is_simple

src/black/nodes.py:558–564  ·  view source on GitHub ↗
(node: LN)

Source from the content-addressed store, hash-verified

556 """Whether whitespace around `**` should be removed."""
557
558 def is_simple(node: LN) -> bool:
559 if isinstance(node, Leaf):
560 return node.type in (token.NAME, token.NUMBER, token.DOT, token.DOUBLESTAR)
561 elif node.type == syms.factor: # unary operators
562 return is_simple(node.children[1])
563 else:
564 return all(is_simple(child) for child in node.children)
565
566 return (
567 node.type == syms.power

Callers 1

is_simple_exponentiationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected