1 import pyexpat.errors as errors
2 import pyexpat.model as model
3 from _typeshed import SupportsRead
4 from typing import Any, Callable, Optional, Tuple
5 from typing_extensions import final
7 EXPAT_VERSION: str # undocumented
8 version_info: tuple[int, int, int] # undocumented
9 native_encoding: str # undocumented
10 features: list[tuple[str, int]] # undocumented
12 class ExpatError(Exception):
19 XML_PARAM_ENTITY_PARSING_NEVER: int
20 XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE: int
21 XML_PARAM_ENTITY_PARSING_ALWAYS: int
23 _Model = Tuple[int, int, Optional[str], Tuple[Any, ...]]
26 class XMLParserType(object):
27 def Parse(self, __data: str | bytes, __isfinal: bool = ...) -> int: ...
28 def ParseFile(self, __file: SupportsRead[bytes]) -> int: ...
29 def SetBase(self, __base: str) -> None: ...
30 def GetBase(self) -> str | None: ...
31 def GetInputContext(self) -> bytes | None: ...
32 def ExternalEntityParserCreate(self, __context: str | None, __encoding: str = ...) -> XMLParserType: ...
33 def SetParamEntityParsing(self, __flag: int) -> int: ...
34 def UseForeignDTD(self, __flag: bool = ...) -> None: ...
38 namespace_prefixes: bool # undocumented
39 ordered_attributes: bool
40 specified_attributes: bool
43 ErrorColumnNumber: int
46 CurrentColumnNumber: int
47 CurrentLineNumber: int
48 XmlDeclHandler: Callable[[str, str | None, int], Any] | None
49 StartDoctypeDeclHandler: Callable[[str, str | None, str | None, bool], Any] | None
50 EndDoctypeDeclHandler: Callable[[], Any] | None
51 ElementDeclHandler: Callable[[str, _Model], Any] | None
52 AttlistDeclHandler: Callable[[str, str, str, str | None, bool], Any] | None
53 StartElementHandler: Callable[[str, dict[str, str]], Any] | Callable[[str, list[str]], Any] | Callable[
54 [str, dict[str, str], list[str]], Any
56 EndElementHandler: Callable[[str], Any] | None
57 ProcessingInstructionHandler: Callable[[str, str], Any] | None
58 CharacterDataHandler: Callable[[str], Any] | None
59 UnparsedEntityDeclHandler: Callable[[str, str | None, str, str | None, str], Any] | None
60 EntityDeclHandler: Callable[[str, bool, str | None, str | None, str, str | None, str | None], Any] | None
61 NotationDeclHandler: Callable[[str, str | None, str, str | None], Any] | None
62 StartNamespaceDeclHandler: Callable[[str, str], Any] | None
63 EndNamespaceDeclHandler: Callable[[str], Any] | None
64 CommentHandler: Callable[[str], Any] | None
65 StartCdataSectionHandler: Callable[[], Any] | None
66 EndCdataSectionHandler: Callable[[], Any] | None
67 DefaultHandler: Callable[[str], Any] | None
68 DefaultHandlerExpand: Callable[[str], Any] | None
69 NotStandaloneHandler: Callable[[], int] | None
70 ExternalEntityRefHandler: Callable[[str, str | None, str | None, str | None], int] | None
72 def ErrorString(__code: int) -> str: ...
74 # intern is undocumented
76 encoding: str | None = ..., namespace_separator: str | None = ..., intern: dict[str, Any] | None = ...
77 ) -> XMLParserType: ...