Skip to content

Commit

Permalink
Fix context type hints (#1303)
Browse files Browse the repository at this point in the history
Co-authored-by: OhioDschungel6 <OhioDschungel6@users.noreply.github.com>
  • Loading branch information
OhioDschungel6 and OhioDschungel6 authored Jun 2, 2024
1 parent fd26293 commit 0c7c2e5
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions python/pydantic_core/_pydantic_core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class SchemaValidator:
*,
strict: bool | None = None,
from_attributes: bool | None = None,
context: dict[str, Any] | None = None,
context: Any | None = None,
self_instance: Any | None = None,
) -> Any:
"""
Expand Down Expand Up @@ -119,7 +119,7 @@ class SchemaValidator:
*,
strict: bool | None = None,
from_attributes: bool | None = None,
context: dict[str, Any] | None = None,
context: Any | None = None,
self_instance: Any | None = None,
) -> bool:
"""
Expand All @@ -136,7 +136,7 @@ class SchemaValidator:
input: str | bytes | bytearray,
*,
strict: bool | None = None,
context: dict[str, Any] | None = None,
context: Any | None = None,
self_instance: Any | None = None,
) -> Any:
"""
Expand All @@ -163,9 +163,7 @@ class SchemaValidator:
Returns:
The validated Python object.
"""
def validate_strings(
self, input: _StringInput, *, strict: bool | None = None, context: dict[str, Any] | None = None
) -> Any:
def validate_strings(self, input: _StringInput, *, strict: bool | None = None, context: Any | None = None) -> Any:
"""
Validate a string against the schema and return the validated Python object.
Expand Down Expand Up @@ -194,7 +192,7 @@ class SchemaValidator:
*,
strict: bool | None = None,
from_attributes: bool | None = None,
context: dict[str, Any] | None = None,
context: Any | None = None,
) -> dict[str, Any] | tuple[dict[str, Any], dict[str, Any] | None, set[str]]:
"""
Validate an assignment to a field on a model.
Expand Down Expand Up @@ -267,7 +265,7 @@ class SchemaSerializer:
warnings: bool | Literal['none', 'warn', 'error'] = True,
fallback: Callable[[Any], Any] | None = None,
serialize_as_any: bool = False,
context: dict[str, Any] | None = None,
context: Any | None = None,
) -> Any:
"""
Serialize/marshal a Python object to a Python object including transforming and filtering data.
Expand Down Expand Up @@ -313,7 +311,7 @@ class SchemaSerializer:
warnings: bool | Literal['none', 'warn', 'error'] = True,
fallback: Callable[[Any], Any] | None = None,
serialize_as_any: bool = False,
context: dict[str, Any] | None = None,
context: Any | None = None,
) -> bytes:
"""
Serialize a Python object to JSON including transforming and filtering data.
Expand Down Expand Up @@ -359,7 +357,7 @@ def to_json(
serialize_unknown: bool = False,
fallback: Callable[[Any], Any] | None = None,
serialize_as_any: bool = False,
context: dict[str, Any] | None = None,
context: Any | None = None,
) -> bytes:
"""
Serialize a Python object to JSON including transforming and filtering data.
Expand Down Expand Up @@ -434,7 +432,7 @@ def to_jsonable_python(
serialize_unknown: bool = False,
fallback: Callable[[Any], Any] | None = None,
serialize_as_any: bool = False,
context: dict[str, Any] | None = None,
context: Any | None = None,
) -> Any:
"""
Serialize/marshal a Python object to a JSON-serializable Python object including transforming and filtering data.
Expand Down

0 comments on commit 0c7c2e5

Please sign in to comment.