1
1
import xml .dom .minidom
2
2
from _typeshed import Self
3
- from collections .abc import Iterable , Sequence
4
- from typing import Any , Callable , Generator , Protocol , TypeVar , overload
3
+ from collections .abc import Iterable , Sequence , Callable , Generator
4
+ from typing import Any , ClassVar , Protocol , TypeVar , overload
5
5
from typing_extensions import Literal
6
6
7
7
from docutils .transforms import Transformer
8
8
9
- class NodeVisitor :
10
- def __init__ (self , document : document ): ...
11
- def __getattr__ (self , __name : str ) -> Any : ... # incomplete
12
-
13
9
_N = TypeVar ("_N" , bound = Node )
14
10
15
11
class _DomModule (Protocol ):
16
12
Document : type [xml .dom .minidom .Document ]
17
13
18
14
class Node :
15
+ # children is initialized by the subclasses
19
16
children : Sequence [Node ]
20
17
parent : Node | None
21
18
source : str | None
@@ -95,7 +92,7 @@ class Element(Node):
95
92
def __getattr__ (self , __name : str ) -> Any : ... # incomplete
96
93
97
94
class Text (Node , str ):
98
- tagname : str
95
+ tagname : ClassVar [ str ]
99
96
children : tuple [()]
100
97
101
98
# we omit the rawsource parameter because it has been deprecated and is ignored
@@ -112,4 +109,8 @@ class document(Root, Structural, Element):
112
109
transformer : Transformer
113
110
def __getattr__ (self , __name : str ) -> Any : ... # incomplete
114
111
112
+ class NodeVisitor :
113
+ def __init__ (self , document : document ): ...
114
+ def __getattr__ (self , __name : str ) -> Any : ... # incomplete
115
+
115
116
def __getattr__ (name : str ) -> Any : ... # incomplete
0 commit comments