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

Method _traverse

example_code/item_054.py:106–113  ·  view source on GitHub ↗
(self, key, value)

Source from the content-addressed store, hash-verified

104 self.parent = parent
105
106 def _traverse(self, key, value):
107 if (
108 isinstance(value, BinaryTreeWithParent)
109 and key == "parent"
110 ):
111 return value.value # Prevent cycles
112 else:
113 return super()._traverse(key, value)
114
115
116print("Example 5")

Callers

nothing calls this directly

Calls 1

_traverseMethod · 0.45

Tested by

no test coverage detected