diff --git a/pydantic/mypy.py b/pydantic/mypy.py index 1d6d5ae283d..fdd05bd0c58 100644 --- a/pydantic/mypy.py +++ b/pydantic/mypy.py @@ -57,6 +57,7 @@ Type, TypeOfAny, TypeType, + TypeVarId, TypeVarType, UnionType, get_proper_type, @@ -498,7 +499,7 @@ def add_construct_method(self, fields: List['PydanticModelField']) -> None: tvd = TypeVarType( self_tvar_name, tvar_fullname, - -1, + TypeVarId(-1), [], obj_type, AnyType(TypeOfAny.from_omitted_generics), # type: ignore[arg-type]