Skip to content

Commit d5c5202

Browse files
committed
Type validation context as dict[str, Any] | None
1 parent f43fab3 commit d5c5202

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

python/pydantic_core/_pydantic_core.pyi

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class SchemaValidator:
5353
*,
5454
strict: 'bool | None' = None,
5555
from_attributes: 'bool | None' = None,
56-
context: Any = None,
56+
context: 'dict[str, Any] | None' = None,
5757
self_instance: 'Any | None' = None,
5858
) -> Any: ...
5959
def isinstance_python(
@@ -62,15 +62,15 @@ class SchemaValidator:
6262
*,
6363
strict: 'bool | None' = None,
6464
from_attributes: 'bool | None' = None,
65-
context: Any = None,
65+
context: 'dict[str, Any] | None' = None,
6666
self_instance: 'Any | None' = None,
6767
) -> bool: ...
6868
def validate_json(
6969
self,
7070
input: 'str | bytes | bytearray',
7171
*,
7272
strict: 'bool | None' = None,
73-
context: Any = None,
73+
context: 'dict[str, Any] | None' = None,
7474
self_instance: 'Any | None' = None,
7575
) -> Any: ...
7676
def validate_assignment(
@@ -81,9 +81,11 @@ class SchemaValidator:
8181
*,
8282
strict: 'bool | None' = None,
8383
from_attributes: 'bool | None' = None,
84-
context: Any = None,
84+
context: 'dict[str, Any] | None' = None,
8585
) -> 'dict[str, Any]': ...
86-
def get_default_value(self, *, strict: 'bool | None' = None, context: Any = None) -> Some | None: ...
86+
def get_default_value(
87+
self, *, strict: 'bool | None' = None, context: 'dict[str, Any] | None' = None
88+
) -> Some | None: ...
8789

8890
IncEx: TypeAlias = 'set[int] | set[str] | dict[int, IncEx] | dict[str, IncEx] | None'
8991

python/pydantic_core/core_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class ValidationInfo(Protocol):
144144
"""
145145

146146
@property
147-
def context(self) -> Any | None:
147+
def context(self) -> dict[str, Any] | None:
148148
"""Current validation context."""
149149
...
150150

0 commit comments

Comments
 (0)