feat: renamed
This commit is contained in:
parent
b30824baf9
commit
684c90a7b4
@ -177,7 +177,7 @@ class Node(Generator[P]):
|
|||||||
):
|
):
|
||||||
self.value = value
|
self.value = value
|
||||||
self.depth = 0
|
self.depth = 0
|
||||||
self.same_level_index: int = 0
|
self.index: int = 0
|
||||||
|
|
||||||
|
|
||||||
self.children: List[Node[P]] = kwargs.get("children", [])
|
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]:
|
def __iter__(self, **kwargs) -> Generator[Node[P], None, None]:
|
||||||
_level_index_map: Dict[int, int] = kwargs.get("level_index_map", defaultdict(lambda: 0))
|
_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
|
yield self
|
||||||
_level_index_map[self.depth] += 1
|
_level_index_map[self.depth] += 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user