diff --git a/pydantic/generics.py b/pydantic/generics.py index 2467bb77111..1ec9a7da081 100644 --- a/pydantic/generics.py +++ b/pydantic/generics.py @@ -31,13 +31,13 @@ Parametrization = Mapping[TypeVarType, Type[Any]] -_generic_types_cache: LimitedDict[Tuple[Type[Any], Union[Any, Tuple[Any, ...]]], Type[BaseModel]] = LimitedDict() +_generic_types_cache: 'LimitedDict[Tuple[Type[Any], Union[Any, Tuple[Any, ...]]], Type[BaseModel]]' = LimitedDict() # _assigned_parameters is a Mapping from parametrized version of generic models to assigned types of parametrizations # as captured during construction of the class (not instances). # E.g., for generic model `Model[A, B]`, when parametrized model `Model[int, str]` is created, # `Model[int, str]`: {A: int, B: str}` will be stored in `_assigned_parameters`. # (This information is only otherwise available after creation from the class name string). -_assigned_parameters: LimitedDict[Type[Any], Parametrization] = LimitedDict() +_assigned_parameters: 'LimitedDict[Type[Any], Parametrization]' = LimitedDict() class GenericModel(BaseModel): diff --git a/pydantic/utils.py b/pydantic/utils.py index f9c4ec16022..71599a540f2 100644 --- a/pydantic/utils.py +++ b/pydantic/utils.py @@ -783,7 +783,3 @@ def __setitem__(self, __key: Any, __value: Any) -> None: to_remove = list(self.keys())[:excess] for key in to_remove: del self[key] - - def __class_getitem__(cls, *args: Any) -> Any: - # to avoid errors with 3.7 - pass