>>> list(Node(0)) [0] >>> list(Node(0, Node(-1), Node(1), None)) [-1, 0, 1]
(self)
| 104 | parent: Node | None = None # Added in order to delete a node easier |
| 105 | |
| 106 | def __iter__(self) -> Iterator[int]: |
| 107 | """ |
| 108 | >>> list(Node(0)) |
| 109 | [0] |
| 110 | >>> list(Node(0, Node(-1), Node(1), None)) |
| 111 | [-1, 0, 1] |
| 112 | """ |
| 113 | yield from self.left or [] |
| 114 | yield self.value |
| 115 | yield from self.right or [] |
| 116 | |
| 117 | def __repr__(self) -> str: |
| 118 | from pprint import pformat |
nothing calls this directly
no outgoing calls
no test coverage detected