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

Function is_tuple_containing_star

src/black/nodes.py:654–662  ·  view source on GitHub ↗

Return True if `node` holds a tuple that contains a star operator.

(node: LN)

Source from the content-addressed store, hash-verified

652
653
654def is_tuple_containing_star(node: LN) -> bool:
655 """Return True if `node` holds a tuple that contains a star operator."""
656 if node.type != syms.atom:
657 return False
658 gexp = unwrap_singleton_parenthesis(node)
659 if gexp is None or gexp.type != syms.testlist_gexp:
660 return False
661
662 return any(child.type == syms.star_expr for child in gexp.children)
663
664
665def is_generator(node: LN) -> bool:

Callers 1

Calls 1

Tested by

no test coverage detected