-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bug V1Bug related to Pydantic V1.XBug related to Pydantic V1.X
Description
Checks
- I added a descriptive title to this issue
- I have searched (google, github) for similar issues and couldn't find anything
- I have read and followed the docs and still think this is a bug
Bug
from typing import Generic, TypeVar
from pydantic import Field, create_model
from pydantic.generics import GenericModel
T = TypeVar("T")
class TestGenericModel(GenericModel):
pass
AAModel = create_model("AAModel", __base__=(TestGenericModel, Generic[T]), aa=(int, Field(0)))
AAModel[int](aa=1)
output
Traceback (most recent call last):
File "test.py", line 13, in <module>
AAModel = create_model("AAModel", __base__=(TestGenericModel, Generic[T]), aa=(int, Field(0)))
File "pydantic/main.py", line 972, in pydantic.main.create_model
TypeError: type() doesn't support MRO entry resolution; use types.new_class()axelv
Metadata
Metadata
Assignees
Labels
bug V1Bug related to Pydantic V1.XBug related to Pydantic V1.X