(self, index: int | None)
| 460 | self.__init_handle_by_constructor__(ffi.TuplePattern, fields) # type: ignore |
| 461 | |
| 462 | def __getitem__(self, index: int | None) -> "TupleGetItemPattern": |
| 463 | if index is not None: |
| 464 | # support negative index for being pythonic |
| 465 | if index < 0: |
| 466 | index += len(self) |
| 467 | if index >= len(self): |
| 468 | raise IndexError("TuplePattern index out of range") |
| 469 | else: |
| 470 | index = -1 # -1 means matching any index |
| 471 | return TupleGetItemPattern(self, index) |
| 472 | |
| 473 | def __len__(self): |
| 474 | return len(self.fields) |
nothing calls this directly
no test coverage detected