|
1 | 1 | import xml.dom.minidom
|
2 | 2 | from _typeshed import Incomplete
|
3 | 3 | from abc import abstractmethod
|
4 |
| -from collections.abc import Callable, Generator, Iterable, Sequence |
| 4 | +from collections.abc import Callable, Generator, Iterable, Iterator, Sequence |
5 | 5 | from typing import Any, ClassVar, Protocol, TypeVar, overload
|
6 | 6 | from typing_extensions import Literal, Self
|
7 | 7 |
|
@@ -82,6 +82,9 @@ class Element(Node):
|
82 | 82 | def __init__(self, rawsource: str = "", *children: Node, **attributes): ...
|
83 | 83 | def __len__(self) -> int: ...
|
84 | 84 | def __contains__(self, key: str | Node) -> bool: ...
|
| 85 | + # '__iter__' is added as workaround, since mypy doesn't support classes that are iterable via '__getitem__' |
| 86 | + # see https://github.com/python/typeshed/pull/10099#issuecomment-1528789395 |
| 87 | + def __iter__(self) -> Iterator[Node]: ... |
85 | 88 | @overload
|
86 | 89 | def __getitem__(self, key: str) -> Any: ...
|
87 | 90 | @overload
|
@@ -120,6 +123,8 @@ class Text(Node, str):
|
120 | 123 | def lstrip(self, chars: str | None = None) -> str: ...
|
121 | 124 |
|
122 | 125 | class Structural: ...
|
| 126 | +class Body: ... |
| 127 | +class General(Body): ... |
123 | 128 | class Root: ...
|
124 | 129 |
|
125 | 130 | class document(Root, Structural, Element):
|
|
0 commit comments