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

Function is_tuple

src/black/nodes.py:632–640  ·  view source on GitHub ↗

Return True if `node` holds a tuple.

(node: LN)

Source from the content-addressed store, hash-verified

630
631
632def is_tuple(node: LN) -> bool:
633 """Return True if `node` holds a tuple."""
634 if node.type != syms.atom:
635 return False
636 gexp = unwrap_singleton_parenthesis(node)
637 if gexp is None or gexp.type != syms.testlist_gexp:
638 return False
639
640 return True
641
642
643def is_tuple_containing_walrus(node: LN) -> bool:

Callers 1

Calls 1

Tested by

no test coverage detected