WIP: feature/cleanup_programming_interface #40
@ -177,7 +177,7 @@ class Node(Generator[P]):
|
||||
):
|
||||
self.value = value
|
||||
self.depth = 0
|
||||
self.same_level_index: int = 0
|
||||
self.index: int = 0
|
||||
|
||||
|
||||
self.children: List[Node[P]] = kwargs.get("children", [])
|
||||
@ -196,7 +196,7 @@ class Node(Generator[P]):
|
||||
def __iter__(self, **kwargs) -> Generator[Node[P], None, None]:
|
||||
_level_index_map: Dict[int, int] = kwargs.get("level_index_map", defaultdict(lambda: 0))
|
||||
|
||||
self.same_level_index = _level_index_map[self.depth]
|
||||
self.index = _level_index_map[self.depth]
|
||||
yield self
|
||||
_level_index_map[self.depth] += 1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user