(self, iterable: Iterable | None = None, box_class: type[box.Box] = box.Box, **box_options)
| 50 | return obj |
| 51 | |
| 52 | def __init__(self, iterable: Iterable | None = None, box_class: type[box.Box] = box.Box, **box_options): |
| 53 | self.box_options = box_options |
| 54 | self.box_options["box_class"] = box_class |
| 55 | self.box_org_ref = iterable |
| 56 | if iterable: |
| 57 | for x in iterable: |
| 58 | self.append(x) |
| 59 | self.box_org_ref = None |
| 60 | if box_options.get("frozen_box"): |
| 61 | |
| 62 | def frozen(*args, **kwargs): |
| 63 | raise BoxError("BoxList is frozen") |
| 64 | |
| 65 | for method in ["append", "extend", "insert", "pop", "remove", "reverse", "sort"]: |
| 66 | self.__setattr__(method, frozen) |
| 67 | |
| 68 | def __getitem__(self, item): |
| 69 | if self.box_options.get("box_dots") and isinstance(item, str) and item.startswith("["): |
nothing calls this directly
no test coverage detected