MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / to_dict

Method to_dict

example_code/item_054.py:52–53  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

50print("Example 1")
51class ToDictMixin:
52 def to_dict(self):
53 return self._traverse_dict(self.__dict__)
54
55 def _traverse_dict(self, instance_dict):
56 output = {}

Callers 3

_traverseMethod · 0.80
item_054.pyFile · 0.80
to_jsonMethod · 0.80

Calls 1

_traverse_dictMethod · 0.95

Tested by

no test coverage detected