Skip to content

Commit 4efc9bb

Browse files
committed
address srittau's comments
1 parent 412d36f commit 4efc9bb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

stubs/xmltodict/xmltodict.pyi

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite
2-
from collections.abc import Callable, Container, Mapping
3-
from types import GeneratorType
2+
from collections.abc import Callable, Container, Generator, Mapping
43
from typing import Any, Final, overload
54
from typing_extensions import TypeAlias
65

@@ -59,7 +58,7 @@ class _DictSAXHandler:
5958
def push_data(self, item: _AttrDict | None, key: str, data: str) -> _AttrDict: ...
6059

6160
def parse(
62-
xml_input: str | ReadableBuffer | SupportsRead[bytes] | GeneratorType[ReadableBuffer, None, None],
61+
xml_input: str | ReadableBuffer | SupportsRead[bytes] | Generator[ReadableBuffer],
6362
encoding: str | None = None,
6463
expat: Any = ...,
6564
process_namespaces: bool = False,
@@ -93,6 +92,8 @@ def unparse(
9392
attr_prefix: str = "@",
9493
cdata_key: str = "#text",
9594
depth: int = 0,
95+
# preprocessor is called like (preprocessor(key, value) for key, value in input_dict.items()).
96+
# It is expected to return its input, or a modification thereof
9697
preprocessor: Callable[[str, Any], tuple[str, Any]] | None = None,
9798
pretty: bool = False,
9899
newl: str = "\n",
@@ -113,6 +114,8 @@ def unparse(
113114
attr_prefix: str = "@",
114115
cdata_key: str = "#text",
115116
depth: int = 0,
117+
# preprocessor is called like (preprocessor(key, value) for key, value in input_dict.items()).
118+
# It is expected to return its input, or a modification thereof
116119
preprocessor: Callable[[str, Any], tuple[str, Any]] | None = None,
117120
pretty: bool = False,
118121
newl: str = "\n",

0 commit comments

Comments
 (0)