Skip to content

Commit 3351da5

Browse files
sedat4rasclaude
andcommitted
Update URIDict types in jsonschema _utils stubs
Change URIDict to use MutableMapping[str, Any] as the value type throughout, consistent with the actual runtime behavior where store values are schema documents (JSON objects), not plain strings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 34c8cc7 commit 3351da5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stubs/jsonschema/jsonschema/_utils.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
from _typeshed import Incomplete, SupportsKeysAndGetItem, SupportsNext, SupportsRichComparison
22
from collections.abc import Generator, Iterable, Iterator, Mapping, MutableMapping
3-
from typing import Literal, TypeVar, overload
3+
from typing import Any, Literal, TypeVar, overload
44

55
_T = TypeVar("_T")
66

7-
class URIDict(MutableMapping[str, str]):
7+
class URIDict(MutableMapping[str, MutableMapping[str, Any]]):
88
def normalize(self, uri: str) -> str: ...
9-
store: dict[str, str]
10-
def __init__(self, m: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]], /, **kwargs: str) -> None: ...
11-
def __getitem__(self, uri: str) -> str: ...
12-
def __setitem__(self, uri: str, value: str) -> None: ...
9+
store: dict[str, MutableMapping[str, Any]]
10+
def __init__(self, m: SupportsKeysAndGetItem[str, MutableMapping[str, Any]] | Iterable[tuple[str, MutableMapping[str, Any]]], /, **kwargs: MutableMapping[str, Any]) -> None: ...
11+
def __getitem__(self, uri: str) -> MutableMapping[str, Any]: ...
12+
def __setitem__(self, uri: str, value: MutableMapping[str, Any]) -> None: ...
1313
def __delitem__(self, uri: str) -> None: ...
1414
def __iter__(self) -> Iterator[str]: ...
1515
def __len__(self) -> int: ...

0 commit comments

Comments
 (0)