Skip to content

Commit b313981

Browse files
committed
Fix runtime type issues
1 parent a182903 commit b313981

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

anytree/iterators/abstractiter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
from ..node.nodemixin import NodeMixin
1414

1515

16-
NodeT = TypeVar("NodeT", bound=NodeMixin[Any] | LightNodeMixin[Any], covariant=True)
16+
NodeT = TypeVar("NodeT", bound="NodeMixin[Any] | LightNodeMixin[Any]", covariant=True)
1717

1818

19-
class AbstractIter(six.Iterator, Generic[NodeT]):
19+
class AbstractIter(Generic[NodeT], six.Iterator):
2020
# pylint: disable=R0205
2121
"""
2222
Iterate over tree starting at `node`.

anytree/node/anynode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from collections.abc import Iterable
1212

1313

14-
class AnyNode(NodeMixin[AnyNode]):
14+
class AnyNode(NodeMixin["AnyNode"]):
1515
"""
1616
A generic tree node with any `kwargs`.
1717

anytree/node/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from collections.abc import Iterable
1212

1313

14-
class Node(NodeMixin[Node]):
14+
class Node(NodeMixin["Node"]):
1515
"""
1616
A simple tree node with a `name` and any `kwargs`.
1717

anytree/node/symlinknode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from .nodemixin import NodeMixin
1515

1616

17-
NodeT = TypeVar("NodeT", bound=NodeMixin[Any] | LightNodeMixin[Any], covariant=True)
17+
NodeT = TypeVar("NodeT", bound="NodeMixin[Any] | LightNodeMixin[Any]", covariant=True)
1818

1919

2020
class SymlinkNode(SymlinkNodeMixin, Generic[NodeT]):

anytree/node/symlinknodemixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .nodemixin import NodeMixin
66

77

8-
class SymlinkNodeMixin(NodeMixin[SymlinkNodeMixin]):
8+
class SymlinkNodeMixin(NodeMixin["SymlinkNodeMixin"]):
99
"""
1010
The :any:`SymlinkNodeMixin` class extends any Python class to a symbolic link to a tree node.
1111

0 commit comments

Comments
 (0)