Skip to content

Commit c897c82

Browse files
docutils: address feedback by Sebastian
1 parent a511354 commit c897c82

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

stubs/docutils/docutils/nodes.pyi

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
import xml.dom.minidom
22
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
55
from typing_extensions import Literal
66

77
from docutils.transforms import Transformer
88

9-
class NodeVisitor:
10-
def __init__(self, document: document): ...
11-
def __getattr__(self, __name: str) -> Any: ... # incomplete
12-
139
_N = TypeVar("_N", bound=Node)
1410

1511
class _DomModule(Protocol):
1612
Document: type[xml.dom.minidom.Document]
1713

1814
class Node:
15+
# children is initialized by the subclasses
1916
children: Sequence[Node]
2017
parent: Node | None
2118
source: str | None
@@ -95,7 +92,7 @@ class Element(Node):
9592
def __getattr__(self, __name: str) -> Any: ... # incomplete
9693

9794
class Text(Node, str):
98-
tagname: str
95+
tagname: ClassVar[str]
9996
children: tuple[()]
10097

10198
# we omit the rawsource parameter because it has been deprecated and is ignored
@@ -112,4 +109,8 @@ class document(Root, Structural, Element):
112109
transformer: Transformer
113110
def __getattr__(self, __name: str) -> Any: ... # incomplete
114111

112+
class NodeVisitor:
113+
def __init__(self, document: document): ...
114+
def __getattr__(self, __name: str) -> Any: ... # incomplete
115+
115116
def __getattr__(name: str) -> Any: ... # incomplete

0 commit comments

Comments
 (0)