Return True if `node` holds a tuple that contains a walrus operator.
(node: LN)
| 641 | |
| 642 | |
| 643 | def is_tuple_containing_walrus(node: LN) -> bool: |
| 644 | """Return True if `node` holds a tuple that contains a walrus operator.""" |
| 645 | if node.type != syms.atom: |
| 646 | return False |
| 647 | gexp = unwrap_singleton_parenthesis(node) |
| 648 | if gexp is None or gexp.type != syms.testlist_gexp: |
| 649 | return False |
| 650 | |
| 651 | return any(child.type == syms.namedexpr_test for child in gexp.children) |
| 652 | |
| 653 | |
| 654 | def is_tuple_containing_star(node: LN) -> bool: |
no test coverage detected