Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions stubs/xmltodict/@tests/test_cases/check_namespaces.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from __future__ import annotations

import xmltodict

ns: dict[str, None] = {"http://example.com/": None}
xmltodict.parse("<a/>", namespaces=ns)
10 changes: 5 additions & 5 deletions stubs/xmltodict/xmltodict.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class _DictSAXHandler:
dict_constructor: type
strip_whitespace: bool
namespace_separator: str
namespaces: dict[str, str] | None
namespaces: Mapping[str, str | None] | None
namespace_declarations: dict[str, str]
force_list: bool | Container[str] | Callable[[tuple[str, _AttrDict | None], str, str], bool] | None
comment_key: str
Expand All @@ -42,7 +42,7 @@ class _DictSAXHandler:
dict_constructor: type = ...,
strip_whitespace: bool = True,
namespace_separator: str = ":",
namespaces: dict[str, str] | None = None,
namespaces: Mapping[str, str | None] | None = None,
force_list: bool | Container[str] | Callable[[tuple[str, _AttrDict | None], str, str], bool] | None = None,
comment_key: str = "#comment",
) -> None: ...
Expand Down Expand Up @@ -72,7 +72,7 @@ def parse(
postprocessor: Callable[[list[tuple[str, _AttrDict | None]], str, _AttrValue], tuple[str, _AttrValue]] | None = None,
dict_constructor: type = ...,
strip_whitespace: bool = True,
namespaces: dict[str, str] | None = None,
namespaces: Mapping[str, str | None] | None = None,
force_list: bool | Container[str] | Callable[[tuple[str, _AttrDict | None], str, str], bool] | None = None,
comment_key: str = "#comment",
) -> dict[str, Any]: ...
Expand All @@ -95,7 +95,7 @@ def unparse(
newl: str = "\n",
indent: str | int = "\t",
namespace_separator: str = ":",
namespaces: Mapping[str, str] | None = None,
namespaces: Mapping[str, str | None] | None = None,
expand_iter: str | None = None,
) -> None: ...
@overload
Expand All @@ -117,6 +117,6 @@ def unparse(
newl: str = "\n",
indent: str | int = "\t",
namespace_separator: str = ":",
namespaces: Mapping[str, str] | None = None,
namespaces: Mapping[str, str | None] | None = None,
expand_iter: str | None = None,
) -> str: ...