Skip to content

Commit 14c0873

Browse files
authored
[xmltodict] Update to 1.0.* (#14712)
1 parent 617f423 commit 14c0873

File tree

3 files changed

+57
-19
lines changed

3 files changed

+57
-19
lines changed

pyrightconfig.stricter.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"stubs/tqdm",
9393
"stubs/vobject",
9494
"stubs/workalendar",
95+
"stubs/xmltodict",
9596
],
9697
"typeCheckingMode": "strict",
9798
// TODO: Complete incomplete stubs

stubs/xmltodict/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "0.15.*"
1+
version = "1.0.*"
22
upstream_repository = "https://github.com/martinblech/xmltodict"

stubs/xmltodict/xmltodict.pyi

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,75 @@
1-
from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite
1+
from _typeshed import Incomplete, ReadableBuffer, SupportsRead, SupportsWrite
22
from collections import OrderedDict
33
from collections.abc import Mapping
44
from types import GeneratorType
5-
from typing import Any, overload
5+
from typing import Any, Final, overload
66

7-
__license__: str
7+
__author__: Final[str]
8+
__version__: Final[str]
9+
__license__: Final[str]
810

911
class ParsingInterrupted(Exception): ...
1012

1113
def parse(
1214
xml_input: str | ReadableBuffer | SupportsRead[bytes] | GeneratorType[ReadableBuffer, Any, Any],
13-
encoding: str | None = ...,
15+
encoding: str | None = None,
1416
expat: Any = ...,
15-
process_namespaces: bool = ...,
16-
namespace_separator: str = ...,
17-
disable_entities: bool = ...,
18-
process_comments: bool = ...,
19-
**kwargs: Any,
17+
process_namespaces: bool = False,
18+
namespace_separator: str = ":",
19+
disable_entities: bool = True,
20+
process_comments: bool = False,
21+
*,
22+
item_depth: int = 0,
23+
item_callback=...,
24+
xml_attribs: bool = True,
25+
attr_prefix="@",
26+
cdata_key="#text",
27+
force_cdata: bool | Incomplete = False,
28+
cdata_separator="",
29+
postprocessor=None,
30+
dict_constructor: type = ...,
31+
strip_whitespace: bool = True,
32+
namespaces=None,
33+
force_list: bool | Incomplete = None,
34+
comment_key: str = "#comment",
2035
) -> OrderedDict[str, Any]: ...
2136
@overload
2237
def unparse(
2338
input_dict: Mapping[str, Any],
2439
output: SupportsWrite[bytes] | SupportsWrite[str],
25-
encoding: str = ...,
26-
full_document: bool = ...,
27-
short_empty_elements: bool = ...,
28-
**kwargs: Any,
40+
encoding: str = "utf-8",
41+
full_document: bool = True,
42+
short_empty_elements: bool = False,
43+
comment_key: str = "#comment",
44+
*,
45+
attr_prefix: str = "@",
46+
cdata_key="#text",
47+
depth: int = 0,
48+
preprocessor=None,
49+
pretty: bool = False,
50+
newl: str = "\n",
51+
indent: str | int = "\t",
52+
namespace_separator: str = ":",
53+
namespaces=None,
54+
expand_iter=None,
2955
) -> None: ...
3056
@overload
3157
def unparse(
3258
input_dict: Mapping[str, Any],
33-
output: None = ...,
34-
encoding: str = ...,
35-
full_document: bool = ...,
36-
short_empty_elements: bool = ...,
37-
**kwargs: Any,
59+
output: None = None,
60+
encoding: str = "utf-8",
61+
full_document: bool = True,
62+
short_empty_elements: bool = False,
63+
comment_key: str = "#comment",
64+
*,
65+
attr_prefix: str = "@",
66+
cdata_key="#text",
67+
depth: int = 0,
68+
preprocessor=None,
69+
pretty: bool = False,
70+
newl: str = "\n",
71+
indent: str | int = "\t",
72+
namespace_separator: str = ":",
73+
namespaces=None,
74+
expand_iter=None,
3875
) -> str: ...

0 commit comments

Comments
 (0)