diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 99c3312723cc..cd4331e8bf0b 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -92,6 +92,7 @@ "stubs/tqdm", "stubs/vobject", "stubs/workalendar", + "stubs/xmltodict", ], "typeCheckingMode": "strict", // TODO: Complete incomplete stubs diff --git a/stubs/xmltodict/METADATA.toml b/stubs/xmltodict/METADATA.toml index 652259c6d77c..ae5a40081b9b 100644 --- a/stubs/xmltodict/METADATA.toml +++ b/stubs/xmltodict/METADATA.toml @@ -1,2 +1,2 @@ -version = "0.15.*" +version = "1.0.*" upstream_repository = "https://github.com/martinblech/xmltodict" diff --git a/stubs/xmltodict/xmltodict.pyi b/stubs/xmltodict/xmltodict.pyi index c370329f5de6..26c23d785faa 100644 --- a/stubs/xmltodict/xmltodict.pyi +++ b/stubs/xmltodict/xmltodict.pyi @@ -1,38 +1,75 @@ -from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite +from _typeshed import Incomplete, ReadableBuffer, SupportsRead, SupportsWrite from collections import OrderedDict from collections.abc import Mapping from types import GeneratorType -from typing import Any, overload +from typing import Any, Final, overload -__license__: str +__author__: Final[str] +__version__: Final[str] +__license__: Final[str] class ParsingInterrupted(Exception): ... def parse( xml_input: str | ReadableBuffer | SupportsRead[bytes] | GeneratorType[ReadableBuffer, Any, Any], - encoding: str | None = ..., + encoding: str | None = None, expat: Any = ..., - process_namespaces: bool = ..., - namespace_separator: str = ..., - disable_entities: bool = ..., - process_comments: bool = ..., - **kwargs: Any, + process_namespaces: bool = False, + namespace_separator: str = ":", + disable_entities: bool = True, + process_comments: bool = False, + *, + item_depth: int = 0, + item_callback=..., + xml_attribs: bool = True, + attr_prefix="@", + cdata_key="#text", + force_cdata: bool | Incomplete = False, + cdata_separator="", + postprocessor=None, + dict_constructor: type = ..., + strip_whitespace: bool = True, + namespaces=None, + force_list: bool | Incomplete = None, + comment_key: str = "#comment", ) -> OrderedDict[str, Any]: ... @overload def unparse( input_dict: Mapping[str, Any], output: SupportsWrite[bytes] | SupportsWrite[str], - encoding: str = ..., - full_document: bool = ..., - short_empty_elements: bool = ..., - **kwargs: Any, + encoding: str = "utf-8", + full_document: bool = True, + short_empty_elements: bool = False, + comment_key: str = "#comment", + *, + attr_prefix: str = "@", + cdata_key="#text", + depth: int = 0, + preprocessor=None, + pretty: bool = False, + newl: str = "\n", + indent: str | int = "\t", + namespace_separator: str = ":", + namespaces=None, + expand_iter=None, ) -> None: ... @overload def unparse( input_dict: Mapping[str, Any], - output: None = ..., - encoding: str = ..., - full_document: bool = ..., - short_empty_elements: bool = ..., - **kwargs: Any, + output: None = None, + encoding: str = "utf-8", + full_document: bool = True, + short_empty_elements: bool = False, + comment_key: str = "#comment", + *, + attr_prefix: str = "@", + cdata_key="#text", + depth: int = 0, + preprocessor=None, + pretty: bool = False, + newl: str = "\n", + indent: str | int = "\t", + namespace_separator: str = ":", + namespaces=None, + expand_iter=None, ) -> str: ...