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

Method __dir__

box/box.py:493–509  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

491 raise BoxTypeError('unhashable type: "Box"')
492
493 def __dir__(self) -> list[str]:
494 items = set(super().__dir__())
495 # Only show items accessible by dot notation
496 for key in self.keys():
497 key = str(key)
498 if key.isidentifier() and not iskeyword(key):
499 items.add(key)
500
501 keep_keys = self._box_config["camel_killer_box_keep_keys"] and self._box_config["camel_killer_box"]
502 for key in self.keys():
503 if key not in items or keep_keys:
504 if self._box_config["conversion_box"]:
505 key = self._safe_attr(key)
506 if key:
507 items.add(key)
508
509 return list(items)
510
511 def __contains__(self, item):
512 in_me = super().__contains__(item)

Callers

nothing calls this directly

Calls 2

keysMethod · 0.95
_safe_attrMethod · 0.95

Tested by

no test coverage detected