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

Fix type annotation of ModelMetaclass.__prepare__ #8305

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
4 changes: 2 additions & 2 deletions pydantic/_internal/_model_construction.py
Expand Up @@ -8,7 +8,7 @@
from abc import ABCMeta
from functools import partial
from types import FunctionType
from typing import Any, Callable, Generic, Mapping
from typing import Any, Callable, Generic

import typing_extensions
from pydantic_core import PydanticUndefined, SchemaSerializer
Expand Down Expand Up @@ -216,7 +216,7 @@ def __getattr__(self, item: str) -> Any:
raise AttributeError(item)

@classmethod
def __prepare__(cls, *args: Any, **kwargs: Any) -> Mapping[str, object]:
def __prepare__(cls, *args: Any, **kwargs: Any) -> dict[str, object]:
return _ModelNamespaceDict()

def __instancecheck__(self, instance: Any) -> bool:
Expand Down