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

Method __dir__

box/box.py:502–518  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

500 raise BoxTypeError('unhashable type: "Box"')
501
502 def __dir__(self) -> list[str]:
503 items = set(super().__dir__())
504 # Only show items accessible by dot notation
505 for key in self.keys():
506 key = str(key)
507 if key.isidentifier() and not iskeyword(key):
508 items.add(key)
509
510 keep_keys = self._box_config["camel_killer_box_keep_keys"] and self._box_config["camel_killer_box"]
511 for key in self.keys():
512 if key not in items or keep_keys:
513 if self._box_config["conversion_box"]:
514 key = self._safe_attr(key)
515 if key:
516 items.add(key)
517
518 return list(items)
519
520 def __contains__(self, item):
521 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