8000 adding docstrings by samuelcolvin · Pull Request #795 · pydantic/pydantic-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

adding docstrings #795

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 5 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions python/pydantic_core/__init__.py
9154
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,66 @@

class ErrorDetails(_TypedDict):
type: str
"""
The type of error that occurred, this is an identifier designed for
programmatic use that will change rarely or never.

`type` is unique for each error message, and can hence be used as an identifier to build custom error messages.
"""
loc: tuple[int | str, ...]
"""Tuple of strings and ints identifying where in the schema the error occurred."""
msg: str
"""A human readable error message."""
input: _Any
"""The input data at this `loc` that caused the error."""
ctx: _NotRequired[dict[str, str | int | float]]
"""
Values which are required to render the error message, and could hence be useful in rendering custom error messages.
"""


class InitErrorDetails(_TypedDict):
type: str | PydanticCustomError
"""The type of error that occurred, this should a "slug" identifier that changes rarely or never."""
loc: _NotRequired[tuple[int | str, ...]]
"""Tuple of strings and ints identifying where in the schema the error occurred."""
input: _Any
"""The input data at this `loc` that caused the error."""
ctx: _NotRequired[dict[str, str | int | float]]
"""
Values which are required to render the error message, and could hence be useful in rendering custom error messages.
"""


class ErrorTypeInfo(_TypedDict):
"""
Gives information about errors.
"""

type: ErrorType
"""The type of error that occurred, this should a "slug" identifier that changes rarely or never."""
message_template_python: str
"""String template to render a human readable error message from using context, when the input is Python."""
example_message_python: str
"""Example of a human readable error message, when the input is Python."""
message_template_json: _NotRequired[str]
"""String template to render a human readable error message from using context, when the input is JSON data."""
example_message_json: _NotRequired[str]
"""Example of a human readable error message, when the input is JSON data."""
example_context: dict[str, str | int | float] | None
"""Example of context values."""


class MultiHostHost(_TypedDict):
"""
A host part of a multi-host URL.
"""

username: str | None
"""The username part of this host, or `None`."""
password: str | None
"""The password part of this host, or `None`."""
host: str | None
"""The host part of this host, or `None`."""
port: int | None
"""The port part of this host, or `None`."""
Loading
0