MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __repr__

Method __repr__

data_structures/binary_tree/binary_search_tree.py:117–122  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

115 yield from self.right or []
116
117 def __repr__(self) -> str:
118 from pprint import pformat
119
120 if self.left is None and self.right is None:
121 return str(self.value)
122 return pformat({f"{self.value}": (self.left, self.right)}, indent=1)
123
124 @property
125 def is_right(self) -> bool:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected