Skip to content

Commit 0c7c2e5

Browse files
Fix context type hints (#1303)
Co-authored-by: OhioDschungel6 <OhioDschungel6@users.noreply.github.com>
1 parent fd26293 commit 0c7c2e5

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

python/pydantic_core/_pydantic_core.pyi

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class SchemaValidator:
8989
*,
9090
strict: bool | None = None,
9191
from_attributes: bool | None = None,
92-
context: dict[str, Any] | None = None,
92+
context: Any | None = None,
9393
self_instance: Any | None = None,
9494
) -> Any:
9595
"""
@@ -119,7 +119,7 @@ class SchemaValidator:
119119
*,
120120
strict: bool | None = None,
121121
from_attributes: bool | None = None,
122-
context: dict[str, Any] | None = None,
122+
context: Any | None = None,
123123
self_instance: Any | None = None,
124124
) -> bool:
125125
"""
@@ -136,7 +136,7 @@ class SchemaValidator:
136136
input: str | bytes | bytearray,
137137
*,
138138
strict: bool | None = None,
139-
context: dict[str, Any] | None = None,
139+
context: Any | None = None,
140140
self_instance: Any | None = None,
141141
) -> Any:
142142
"""
@@ -163,9 +163,7 @@ class SchemaValidator:
163163
Returns:
164164
The validated Python object.
165165
"""
166-
def validate_strings(
167-
self, input: _StringInput, *, strict: bool | None = None, context: dict[str, Any] | None = None
168-
) -> Any:
166+
def validate_strings(self, input: _StringInput, *, strict: bool | None = None, context: Any | None = None) -> Any:
169167
"""
170168
Validate a string against the schema and return the validated Python object.
171169
@@ -194,7 +192,7 @@ class SchemaValidator:
194192
*,
195193
strict: bool | None = None,
196194
from_attributes: bool | None = None,
197-
context: dict[str, Any] | None = None,
195+
context: Any | None = None,
198196
) -> dict[str, Any] | tuple[dict[str, Any], dict[str, Any] | None, set[str]]:
199197
"""
200198
Validate an assignment to a field on a model.
@@ -267,7 +265,7 @@ class SchemaSerializer:
267265
warnings: bool | Literal['none', 'warn', 'error'] = True,
268266
fallback: Callable[[Any], Any] | None = None,
269267
serialize_as_any: bool = False,
270-
context: dict[str, Any] | None = None,
268+
context: Any | None = None,
271269
) -> Any:
272270
"""
273271
Serialize/marshal a Python object to a Python object including transforming and filtering data.
@@ -313,7 +311,7 @@ class SchemaSerializer:
313311
warnings: bool | Literal['none', 'warn', 'error'] = True,
314312
fallback: Callable[[Any], Any] | None = None,
315313
serialize_as_any: bool = False,
316-
context: dict[str, Any] | None = None,
314+
context: Any | None = None,
317315
) -> bytes:
318316
"""
319317
Serialize a Python object to JSON including transforming and filtering data.
@@ -359,7 +357,7 @@ def to_json(
359357
serialize_unknown: bool = False,
360358
fallback: Callable[[Any], Any] | None = None,
361359
serialize_as_any: bool = False,
362-
context: dict[str, Any] | None = None,
360+
context: Any | None = None,
363361
) -> bytes:
364362
"""
365363
Serialize a Python object to JSON including transforming and filtering data.
@@ -434,7 +432,7 @@ def to_jsonable_python(
434432
serialize_unknown: bool = False,
435433
fallback: Callable[[Any], Any] | None = None,
436434
serialize_as_any: bool = False,
437-
context: dict[str, Any] | None = None,
435+
context: Any | None = None,
438436
) -> Any:
439437
"""
440438
Serialize/marshal a Python object to a JSON-serializable Python object including transforming and filtering data.

0 commit comments

Comments
 (0)