|
1 | | -from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite |
2 | | -from collections import OrderedDict |
3 | | -from collections.abc import Mapping |
| 1 | +from _typeshed import Incomplete, ReadableBuffer, SupportsRead, SupportsWrite |
| 2 | +from collections.abc import Callable, Mapping |
4 | 3 | from types import GeneratorType |
5 | 4 | from typing import Any, overload |
6 | 5 |
|
| 6 | +__author__: str |
| 7 | +__version__: str |
7 | 8 | __license__: str |
8 | 9 |
|
9 | 10 | class ParsingInterrupted(Exception): ... |
10 | 11 |
|
| 12 | +class _DictSAXHandler: |
| 13 | + path: Incomplete |
| 14 | + stack: Incomplete |
| 15 | + data: Incomplete |
| 16 | + item: Incomplete |
| 17 | + item_depth: Incomplete |
| 18 | + xml_attribs: Incomplete |
| 19 | + item_callback: Incomplete |
| 20 | + attr_prefix: Incomplete |
| 21 | + cdata_key: Incomplete |
| 22 | + force_cdata: Incomplete |
| 23 | + cdata_separator: Incomplete |
| 24 | + postprocessor: Incomplete |
| 25 | + dict_constructor: Incomplete |
| 26 | + strip_whitespace: Incomplete |
| 27 | + namespace_separator: Incomplete |
| 28 | + namespaces: Incomplete |
| 29 | + namespace_declarations: Incomplete |
| 30 | + force_list: Incomplete |
| 31 | + comment_key: Incomplete |
| 32 | + def __init__( |
| 33 | + self, |
| 34 | + item_depth: int = 0, |
| 35 | + item_callback=..., |
| 36 | + xml_attribs: bool = True, |
| 37 | + attr_prefix: str = "@", |
| 38 | + cdata_key: str = "#text", |
| 39 | + force_cdata: bool = False, |
| 40 | + cdata_separator: str = "", |
| 41 | + postprocessor=None, |
| 42 | + dict_constructor=..., |
| 43 | + strip_whitespace: bool = True, |
| 44 | + namespace_separator: str = ":", |
| 45 | + namespaces=None, |
| 46 | + force_list=None, |
| 47 | + comment_key: str = "#comment", |
| 48 | + ) -> None: ... |
| 49 | + def startNamespaceDecl(self, prefix, uri) -> None: ... |
| 50 | + def startElement(self, full_name, attrs) -> None: ... |
| 51 | + def endElement(self, full_name) -> None: ... |
| 52 | + def characters(self, data) -> None: ... |
| 53 | + def comments(self, data) -> None: ... |
| 54 | + def push_data(self, item, key, data): ... |
| 55 | + |
11 | 56 | def parse( |
12 | 57 | xml_input: str | ReadableBuffer | SupportsRead[bytes] | GeneratorType[ReadableBuffer, Any, Any], |
13 | | - encoding: str | None = ..., |
| 58 | + encoding: str | None = None, |
14 | 59 | expat: Any = ..., |
15 | | - process_namespaces: bool = ..., |
16 | | - namespace_separator: str = ..., |
17 | | - disable_entities: bool = ..., |
18 | | - process_comments: bool = ..., |
| 60 | + process_namespaces: bool = False, |
| 61 | + namespace_separator: str = ":", |
| 62 | + disable_entities: bool = True, |
| 63 | + process_comments: bool = False, |
19 | 64 | **kwargs: Any, |
20 | | -) -> OrderedDict[str, Any]: ... |
| 65 | +) -> dict[str, Any]: ... |
21 | 66 | @overload |
22 | 67 | def unparse( |
23 | 68 | input_dict: Mapping[str, Any], |
24 | 69 | output: SupportsWrite[bytes] | SupportsWrite[str], |
25 | | - encoding: str = ..., |
26 | | - full_document: bool = ..., |
27 | | - short_empty_elements: bool = ..., |
28 | | - **kwargs: Any, |
| 70 | + encoding: str = "utf-8", |
| 71 | + full_document: bool = True, |
| 72 | + short_empty_elements: bool = False, |
| 73 | + *, |
| 74 | + attr_prefix: str = "@", |
| 75 | + cdata_key: str = "#text", |
| 76 | + depth: int = 0, |
| 77 | + preprocessor: Callable[[str, Any], tuple[str, Any]] | None = None, |
| 78 | + pretty: bool = False, |
| 79 | + newl: str = "\n", |
| 80 | + indent: str = "\t", |
| 81 | + namespace_separator: str = ":", |
| 82 | + namespaces: dict[str, str] | None = None, |
| 83 | + expand_iter: str | None = None, |
29 | 84 | ) -> None: ... |
30 | 85 | @overload |
31 | 86 | def unparse( |
32 | 87 | input_dict: Mapping[str, Any], |
33 | 88 | output: None = ..., |
34 | | - encoding: str = ..., |
35 | | - full_document: bool = ..., |
36 | | - short_empty_elements: bool = ..., |
37 | | - **kwargs: Any, |
| 89 | + encoding: str = "utf-8", |
| 90 | + full_document: bool = True, |
| 91 | + short_empty_elements: bool = False, |
| 92 | + *, |
| 93 | + attr_prefix: str = "@", |
| 94 | + cdata_key: str = "#text", |
| 95 | + depth: int = 0, |
| 96 | + preprocessor: Callable[[str, Any], tuple[str, Any]] | None = None, |
| 97 | + pretty: bool = False, |
| 98 | + newl: str = "\n", |
| 99 | + indent: str = "\t", |
| 100 | + namespace_separator: str = ":", |
| 101 | + namespaces: dict[str, str] | None = None, |
| 102 | + expand_iter: str | None = None, |
38 | 103 | ) -> str: ... |
0 commit comments