Return True iff `leaf` is part of a slice with non-trivial exprs.
(self, leaf: Leaf)
| 427 | ) |
| 428 | |
| 429 | def is_complex_subscript(self, leaf: Leaf) -> bool: |
| 430 | """Return True iff `leaf` is part of a slice with non-trivial exprs.""" |
| 431 | open_lsqb = self.bracket_tracker.get_open_lsqb() |
| 432 | if open_lsqb is None: |
| 433 | return False |
| 434 | |
| 435 | subscript_start = open_lsqb.next_sibling |
| 436 | |
| 437 | if isinstance(subscript_start, Node): |
| 438 | if subscript_start.type == syms.listmaker: |
| 439 | return False |
| 440 | |
| 441 | if subscript_start.type == syms.subscriptlist: |
| 442 | subscript_start = child_towards(subscript_start, leaf) |
| 443 | |
| 444 | return subscript_start is not None and any( |
| 445 | n.type in TEST_DESCENDANTS for n in subscript_start.pre_order() |
| 446 | ) |
| 447 | |
| 448 | def enumerate_with_length( |
| 449 | self, is_reversed: bool = False |
no test coverage detected