8000 Fix context type hints by OhioDschungel6 · Pull Request #1303 · pydantic/pydantic-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix context type hints #1303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 2, 2024
Merged
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
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