1-
1+ from _typeshed import ReadableBuffer , SupportsRead , SupportsWrite
22from collections .abc import Callable , Mapping
33from types import GeneratorType
44from typing import Any , TypeAlias , overload
55
6- from _typeshed import Incomplete , ReadableBuffer , SupportsRead , SupportsWrite
7-
86__author__ : str
97__version__ : str
108__license__ : str
119
1210class ParsingInterrupted (Exception ): ...
1311
1412# dict as attribute value may be a bug: https://github.com/martinblech/xmltodict/issues/163
15- _AttrValue : TypeAlias = str | dict [str ,str ]
13+ _AttrValue : TypeAlias = str | dict [str , str ]
1614_AttrDict : TypeAlias = dict [str , _AttrValue ]
1715
1816class _DictSAXHandler :
1917 path : list [tuple [str , _AttrDict | None ]] = []
2018 stack : list [tuple [_AttrDict | None , list [str ]]] = []
2119 data : list [str ] = []
22- item : _AttrDict | None
20+ item : _AttrDict | None
2321 item_depth : int = 0
2422 xml_attribs : bool = True
25- item_callback :Callable [[list [tuple [str , _AttrDict | None ]], str | _AttrDict | None ], bool ]
23+ item_callback : Callable [[list [tuple [str , _AttrDict | None ]], str | _AttrDict | None ], bool ]
2624 attr_prefix : str = "@"
2725 cdata_key : str = "#text"
2826 force_cdata : bool = False
2927 cdata_separator : str = ""
30- postprocessor :Callable [[list [tuple [str , _AttrDict | None ]], str , _AttrValue ], tuple [str , _AttrValue ]] | None = None
28+ postprocessor : Callable [[list [tuple [str , _AttrDict | None ]], str , _AttrValue ], tuple [str , _AttrValue ]] | None = None
3129 dict_constructor : type [dict [str , str ]]
3230 strip_whitespace : bool = True
3331 namespace_separator : str = ":"
3432 namespaces : dict [str , str ] | None
3533 namespace_declarations : dict [str , str ] = {}
36- force_list :bool | tuple [str ]| Callable [[tuple [str , _AttrDict | None ], str , str ], bool ]| None = None
34+ force_list : bool | tuple [str ] | Callable [[tuple [str , _AttrDict | None ], str , str ], bool ] | None = None
3735 comment_key : str = "#comment"
3836 def __init__ (
3937 self ,
4038 item_depth : int = 0 ,
41- item_callback :Callable [[list [tuple [str , _AttrDict | None ]], str | _AttrDict | None ], bool ]= ...,
39+ item_callback : Callable [[list [tuple [str , _AttrDict | None ]], str | _AttrDict | None ], bool ] = ...,
4240 xml_attribs : bool = True ,
4341 attr_prefix : str = "@" ,
4442 cdata_key : str = "#text" ,
4543 force_cdata : bool = False ,
4644 cdata_separator : str = "" ,
47- postprocessor :Callable [[list [tuple [str , _AttrDict | None ]], str , _AttrValue ], tuple [str , _AttrValue ]] | None = None ,
48- dict_constructor : type [dict [str , str ]]= ...,
45+ postprocessor : Callable [[list [tuple [str , _AttrDict | None ]], str , _AttrValue ], tuple [str , _AttrValue ]] | None = None ,
46+ dict_constructor : type [dict [str , str ]] = ...,
4947 strip_whitespace : bool = True ,
5048 namespace_separator : str = ":" ,
5149 namespaces : dict [str , str ] | None = None ,
52- force_list :bool | tuple [str ]| Callable [[tuple [str , _AttrDict | None ], str , str ], bool ]| None = None ,
50+ force_list : bool | tuple [str ] | Callable [[tuple [str , _AttrDict | None ], str , str ], bool ] | None = None ,
5351 comment_key : str = "#comment" ,
5452 ) -> None : ...
5553 def startNamespaceDecl (self , prefix : str , uri : str ) -> None : ...
56- def startElement (self , full_name :str , attrs : dict [str , str ] | list [str ]) -> None : ...
54+ def startElement (self , full_name : str , attrs : dict [str , str ] | list [str ]) -> None : ...
5755 def endElement (self , full_name : str ) -> None : ...
5856 def characters (self , data : str ) -> None : ...
5957 def comments (self , data : str ) -> None : ...
60- def push_data (self , item : _AttrDict | None , key : str , data : str ) -> _AttrDict : ...
58+ def push_data (self , item : _AttrDict | None , key : str , data : str ) -> _AttrDict : ...
6159
6260def parse (
63- xml_input : str
64- | ReadableBuffer
65- | SupportsRead [bytes ]
66- | GeneratorType [ReadableBuffer , None , None ],
61+ xml_input : str | ReadableBuffer | SupportsRead [bytes ] | GeneratorType [ReadableBuffer , None , None ],
6762 encoding : str | None = None ,
68- expat :Any = ...,
63+ expat : Any = ...,
6964 process_namespaces : bool = False ,
7065 namespace_separator : str = ":" ,
7166 disable_entities : bool = True ,
7267 process_comments : bool = False ,
7368 * ,
7469 item_depth : int = 0 ,
75- item_callback :Callable [[list [tuple [str , _AttrDict | None ]], str | _AttrDict | None ], bool ]= ...,
70+ item_callback : Callable [[list [tuple [str , _AttrDict | None ]], str | _AttrDict | None ], bool ] = ...,
7671 xml_attribs : bool = True ,
7772 attr_prefix : str = "@" ,
7873 cdata_key : str = "#text" ,
7974 force_cdata : bool = False ,
8075 cdata_separator : str = "" ,
81- postprocessor :Callable [[list [tuple [str , _AttrDict | None ]], str , _AttrValue ], tuple [str , _AttrValue ]] | None = None ,
82- dict_constructor : type [dict [str , str ]]= ...,
76+ postprocessor : Callable [[list [tuple [str , _AttrDict | None ]], str , _AttrValue ], tuple [str , _AttrValue ]] | None = None ,
77+ dict_constructor : type [dict [str , str ]] = ...,
8378 strip_whitespace : bool = True ,
8479 namespaces : dict [str , str ] | None = None ,
85- force_list :bool | tuple [str ]| Callable [[tuple [str , _AttrDict | None ], str , str ], bool ]| None = None ,
80+ force_list : bool | tuple [str ] | Callable [[tuple [str , _AttrDict | None ], str , str ], bool ] | None = None ,
8681 comment_key : str = "#comment" ,
8782) -> dict [str , Any ]: ...
8883@overload
@@ -122,4 +117,4 @@ def unparse(
122117 namespace_separator : str = ":" ,
123118 namespaces : Mapping [str , str ] | None = None ,
124119 expand_iter : str | None = None ,
125- ) -> str : ...
120+ ) -> str : ...
0 commit comments