From 537aec046631b828d65fc1bce78dbdc4058c3843 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sat, 1 May 2021 21:39:54 -0700 Subject: [PATCH] xml.dom.minicompat: complete stub (#5281) --- stdlib/xml/dom/minicompat.pyi | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/stdlib/xml/dom/minicompat.pyi b/stdlib/xml/dom/minicompat.pyi index 964e6fa3f..aa8efd03b 100644 --- a/stdlib/xml/dom/minicompat.pyi +++ b/stdlib/xml/dom/minicompat.pyi @@ -1,3 +1,17 @@ -from typing import Any +from typing import Any, Iterable, List, Optional, Tuple, Type, TypeVar -def __getattr__(name: str) -> Any: ... # incomplete +_T = TypeVar("_T") + +StringTypes: Tuple[Type[str]] + +class NodeList(List[_T]): + length: int + def item(self, index: int) -> Optional[_T]: ... + +class EmptyNodeList(Tuple[Any, ...]): + length: int + def item(self, index: int) -> None: ... + def __add__(self, other: Iterable[_T]) -> NodeList[_T]: ... # type: ignore + def __radd__(self, other: Iterable[_T]) -> NodeList[_T]: ... + +def defproperty(klass: Type[Any], name: str, doc: str) -> None: ...