Skip to content
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

Use classmethod instead of classmethod[Any, Any, Any] #7979

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions pydantic/main.py
Expand Up @@ -43,7 +43,6 @@
from .fields import ComputedFieldInfo, FieldInfo, ModelPrivateAttr
from .fields import Field as _Field

AnyClassMethod = classmethod[Any, Any, Any]
TupleGenerator = typing.Generator[typing.Tuple[str, Any], None, None]
Model = typing.TypeVar('Model', bound='BaseModel')
# should be `set[int] | set[str] | dict[int, IncEx] | dict[str, IncEx] | None`, but mypy can't cope
Expand Down Expand Up @@ -1324,7 +1323,7 @@ def create_model(
__doc__: str | None = None,
__base__: None = None,
__module__: str = __name__,
__validators__: dict[str, AnyClassMethod] | None = None,
__validators__: dict[str, classmethod] | None = None,
__cls_kwargs__: dict[str, Any] | None = None,
**field_definitions: Any,
) -> type[BaseModel]:
Expand All @@ -1339,7 +1338,7 @@ def create_model(
__doc__: str | None = None,
__base__: type[Model] | tuple[type[Model], ...],
__module__: str = __name__,
__validators__: dict[str, AnyClassMethod] | None = None,
__validators__: dict[str, classmethod] | None = None,
__cls_kwargs__: dict[str, Any] | None = None,
**field_definitions: Any,
) -> type[Model]:
Expand All @@ -1353,7 +1352,7 @@ def create_model( # noqa: C901
__doc__: str | None = None,
__base__: type[Model] | tuple[type[Model], ...] | None = None,
__module__: str | None = None,
__validators__: dict[str, AnyClassMethod] | None = None,
__validators__: dict[str, classmethod] | None = None,
__cls_kwargs__: dict[str, Any] | None = None,
__slots__: tuple[str, ...] | None = None,
**field_definitions: Any,
Expand Down