MCPcopy Create free account
hub / github.com/cdgriffith/Box / __init__

Method __init__

box/box_list.py:56–66  ·  view source on GitHub ↗
(self, iterable: Iterable | None = None, box_class: type[box.Box] = box.Box, **box_options)

Source from the content-addressed store, hash-verified

54 return obj
55
56 def __init__(self, iterable: Iterable | None = None, box_class: type[box.Box] = box.Box, **box_options):
57 self.box_options = box_options
58 self.box_options["box_class"] = box_class
59 self.box_org_ref = iterable
60 # 2026-10-10: Iteration does not require a truth value.
61 if iterable is not None:
62 for x in iterable:
63 list.append(self, self._convert(x))
64 if isinstance(iterable, BoxList) and iterable is not self:
65 iterable._comment_copy_to(self)
66 self.box_org_ref = None
67
68 def __getitem__(self, item, _ignore_default=False):
69 if self.box_options.get("box_dots") and isinstance(item, str) and item.startswith("["):

Callers 2

__setstate__Method · 0.95
__deepcopy__Method · 0.45

Calls 3

_convertMethod · 0.95
appendMethod · 0.80
_comment_copy_toMethod · 0.45

Tested by

no test coverage detected