(self, item, _ignore_default=False)
| 96 | """ |
| 97 | |
| 98 | def __getitem__(self, item, _ignore_default=False): |
| 99 | if isinstance(item, str) and item.startswith("["): |
| 100 | list_pos = _tuple_pos_re.match(item) |
| 101 | if list_pos is None: |
| 102 | raise BoxTypeError(f"Invalid list index: {item!r}") |
| 103 | value = tuple.__getitem__(self, int(list_pos.group(1))) |
| 104 | children = item[list_pos.end() :].lstrip(".") |
| 105 | if not children: |
| 106 | return value |
| 107 | if _ignore_default and isinstance(value, (Box, box.BoxList, _BoxTuple)): |
| 108 | return value.__getitem__(children, _ignore_default=True) |
| 109 | return value[children] |
| 110 | return tuple.__getitem__(self, item) |
| 111 | |
| 112 | def _comment_store(self, create: bool = True) -> Any: |
| 113 | store = self.__dict__.get("_box_comments") |
nothing calls this directly
no test coverage detected