Type classes for mode.utils.trees
.
NodeT
Bases: Generic[_T]
Node in a tree data structure.
Source code in mode/utils/types/trees.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70 | class NodeT(Generic[_T]):
"""Node in a tree data structure."""
children: List[Any]
data: Any = None
@classmethod
@abc.abstractmethod
def _new_node(cls, data: _T, **kwargs: Any) -> "NodeT": ...
@abc.abstractmethod
def new(self, data: _T) -> "NodeT": ...
@abc.abstractmethod
def add(self, data: Union[_T, "NodeT[_T]"]) -> None: ...
@abc.abstractmethod
def add_deduplicate(self, data: Union[_T, "NodeT[_T]"]) -> None: ...
@abc.abstractmethod
def discard(self, data: _T) -> None: ...
@abc.abstractmethod
def reattach(self, parent: "NodeT") -> "NodeT": ...
@abc.abstractmethod
def traverse(self) -> Iterator["NodeT"]: ...
@abc.abstractmethod
def walk(self) -> Iterator["NodeT"]: ...
@abc.abstractmethod
def as_graph(self) -> DependencyGraphT: ...
@abc.abstractmethod
def detach(self, parent: "NodeT") -> "NodeT": ...
@property
@abc.abstractmethod
def parent(self) -> Optional["NodeT"]: ...
@parent.setter
def parent(self, node: "NodeT") -> None: ...
@property
@abc.abstractmethod
def root(self) -> Optional["NodeT"]: ...
@root.setter
def root(self, node: "NodeT") -> None: ...
@property
@abc.abstractmethod
def depth(self) -> int: ...
@property
@abc.abstractmethod
def path(self) -> str: ...
|