Add stubs for untangle (#9402)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Richard Nias
2022-12-23 15:24:30 +01:00
committed by GitHub
parent db6644790b
commit 4379a6a509
2 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
version = "1.2.*"
[tool.stubtest]
ignore_missing_stub = false

View File

@@ -0,0 +1,37 @@
from _typeshed import Self
from collections.abc import Iterator, Mapping
from typing import Any
from xml.sax import handler
def is_string(x: object) -> bool: ...
class Element:
children: list[Element]
is_root: bool
cdata: str
def __init__(self, name: str | None, attributes: Mapping[str, Any] | None) -> None: ...
def add_child(self, element: Element) -> None: ...
def add_cdata(self, cdata: str) -> None: ...
def get_attribute(self, key: str) -> Any | None: ...
def get_elements(self, name: str | None = ...) -> list[Element]: ...
def __getitem__(self, key: str) -> Any | None: ...
def __getattr__(self, key: str) -> Element: ...
def __hasattribute__(self, name: str) -> bool: ...
def __iter__(self: Self) -> Iterator[Self]: ...
def __bool__(self) -> bool: ...
__nonzero__ = __bool__
def __eq__(self, val: object) -> bool: ...
def __dir__(self) -> list[str]: ...
def __len__(self) -> int: ...
def __contains__(self, key: str) -> bool: ...
class Handler(handler.ContentHandler):
root: Element
elements: list[Element]
def __init__(self) -> None: ...
def startElement(self, name: str, attributes: Mapping[str, Any]) -> None: ...
def endElement(self, name: str) -> None: ...
def characters(self, cdata: str) -> None: ...
def parse(filename: str, **parser_features: bool) -> Element: ...
def is_url(string: str) -> bool: ...