diff --git a/pydantic/generics.py b/pydantic/generics.py
--- a/pydantic/generics.py
+++ b/pydantic/generics.py
@@ -64,7 +64,11 @@ def __class_getitem__(cls: Type[GenericModelT], params: Union[Type[Any], Tuple[T
         """
 
         def _cache_key(_params: Any) -> Tuple[Type[GenericModelT], Any, Tuple[Any, ...]]:
-            return cls, _params, get_args(_params)
+            args = get_args(_params)
+            # python returns a list for Callables, which is not hashable
+            if len(args) == 2 and isinstance(args[0], list):
+                args = (tuple(args[0]), args[1])
+            return cls, _params, args
 
         cached = _generic_types_cache.get(_cache_key(params))
         if cached is not None:

diff --git a/tests/test_generics.py b/tests/test_generics.py
--- a/tests/test_generics.py
+++ b/tests/test_generics.py
@@ -7,6 +7,7 @@
     ClassVar,
     Dict,
     Generic,
+    Iterable,
     List,
     Mapping,
     Optional,
@@ -234,6 +235,32 @@ class Model(GenericModel, Generic[T]):
     assert len(_generic_types_cache) == cache_size + 2
 
 
+def test_cache_keys_are_hashable():
+    cache_size = len(_generic_types_cache)
+    T = TypeVar('T')
+    C = Callable[[str, Dict[str, Any]], Iterable[str]]
+
+    class MyGenericModel(GenericModel, Generic[T]):
+        t: T
+
+    # Callable's first params get converted to a list, which is not hashable.
+    # Make sure we can handle that special case
+    Simple = MyGenericModel[Callable[[int], str]]
+    assert len(_generic_types_cache) == cache_size + 2
+    # Nested Callables
+    MyGenericModel[Callable[[C], Iterable[str]]]
+    assert len(_generic_types_cache) == cache_size + 4
+    MyGenericModel[Callable[[Simple], Iterable[int]]]
+    assert len(_generic_types_cache) == cache_size + 6
+    MyGenericModel[Callable[[MyGenericModel[C]], Iterable[int]]]
+    assert len(_generic_types_cache) == cache_size + 10
+
+    class Model(BaseModel):
+        x: MyGenericModel[Callable[[C], Iterable[str]]] = Field(...)
+
+    assert len(_generic_types_cache) == cache_size + 10
+
+
 def test_generic_config():
     data_type = TypeVar('data_type')
 

`GenericModel` calling `get_args()` which is not hashable
See https://github.com/pydantic/pydantic/pull/4482#issuecomment-1253289404

From @pepastach 

> We recently bumped Pydantic from 1.10.1 to 1.10.2 and our tests started failing. After some lengthy investigation I found this change to be the root cause. I'd like to ask you for your opinions.
> 
> We have a Pydantic model with a field such as
> 
> ```python
> f: MyGenericModel[Callable[[Task, Dict[str, Any]], Iterable[Result]]] = Field(...)
> ```
> 
> Just importing Python module with this code gives me:
> 
> ```
> cls = <class 'foo.MyGenericModel'>
> params = typing.Callable[[foo.Task, typing.Dict[str, typing.Any]], typing.Iterable[foo.Result]]
> 
>     def __class_getitem__(cls: Type[GenericModelT], params: Union[Type[Any], Tuple[Type[Any], ...]]) -> Type[Any]:
>         """Instantiates a new class from a generic class `cls` and type variables `params`.
>     
>         :param params: Tuple of types the class . Given a generic class
>             `Model` with 2 type variables and a concrete model `Model[str, int]`,
>             the value `(str, int)` would be passed to `params`.
>         :return: New model class inheriting from `cls` with instantiated
>             types described by `params`. If no parameters are given, `cls` is
>             returned as is.
>     
>         """
>     
>         def _cache_key(_params: Any) -> Tuple[Type[GenericModelT], Any, Tuple[Any, ...]]:
>             return cls, _params, get_args(_params)
>     
> >       cached = _generic_types_cache.get(_cache_key(params))
> E       TypeError: unhashable type: 'list'
> ```
> 
> The problem seems to be that the function `GenericModel._cache_key()` now calls `get_args()` which in turns calls Python's `typing.get_args()` -> and this function returns a tuple with a list in it. And that makes it unhashable.
> 
> ```python
> def get_args(tp):
>     """Get type arguments with all substitutions performed.
> 
>     For unions, basic simplifications used by Union constructor are performed.
>     Examples::
>         get_args(Dict[str, int]) == (str, int)
>         get_args(int) == ()
>         get_args(Union[int, Union[T, int], str][int]) == (int, str)
>         get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
>         get_args(Callable[[], T][int]) == ([], int)
>     """
>     if isinstance(tp, _GenericAlias) and not tp._special:
>         res = tp.__args__
>         if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis:
>             res = (list(res[:-1]), res[-1])             # <======== this list is a problem
>         return res
>     return ()
> ```
> 
> If I skip the callable typing and only define the field as
> 
> ```python
> f: MyGenericModel[Callable] = Field(...)
> ```
> 
> then it runs okay.
> 
> Thanks in advance!

---

Reply from @sveinugu

> @pepastach Hmm... Seems we did not think of that. Surprised that typing uses lists and not tuples for Callable arguments, but there is probably a good reason for this (or it might be just that it would be too much a nuisance to switch between brackets and parentheses...). In any case, there might be other examples of unhashable return values from `get_params`, so a simple solution could be to just catch `TypeError` and in that case default to the previous _cache_key generation.
> 
> I am new as contributor to pydantic, but I assume it would be cleanest if you could create another issue for this.


tests/test_generics.py::test_cache_keys_are_hashable
tests/test_generics.py::test_generic_name tests/test_generics.py::test_double_parameterize_error tests/test_generics.py::test_value_validation tests/test_generics.py::test_methods_are_inherited tests/test_generics.py::test_config_is_inherited tests/test_generics.py::test_default_argument tests/test_generics.py::test_default_argument_for_typevar tests/test_generics.py::test_classvar tests/test_generics.py::test_non_annotated_field tests/test_generics.py::test_must_inherit_from_generic tests/test_generics.py::test_parameters_placed_on_generic tests/test_generics.py::test_parameters_must_be_typevar tests/test_generics.py::test_subclass_can_be_genericized tests/test_generics.py::test_parameter_count tests/test_generics.py::test_cover_cache tests/test_generics.py::test_generic_config tests/test_generics.py::test_enum_generic tests/test_generics.py::test_generic tests/test_generics.py::test_alongside_concrete_generics tests/test_generics.py::test_complex_nesting tests/test_generics.py::test_required_value tests/test_generics.py::test_optional_value tests/test_generics.py::test_custom_schema tests/test_generics.py::test_child_schema tests/test_generics.py::test_custom_generic_naming tests/test_generics.py::test_nested tests/test_generics.py::test_partial_specification tests/test_generics.py::test_partial_specification_with_inner_typevar tests/test_generics.py::test_partial_specification_name tests/test_generics.py::test_partial_specification_instantiation tests/test_generics.py::test_partial_specification_instantiation_bounded tests/test_generics.py::test_typevar_parametrization tests/test_generics.py::test_multiple_specification tests/test_generics.py::test_generic_subclass_of_concrete_generic tests/test_generics.py::test_generic_model_pickle tests/test_generics.py::test_generic_model_from_function_pickle_fail tests/test_generics.py::test_generic_model_redefined_without_cache_fail tests/test_generics.py::test_generic_model_caching_detect_order_of_union_args_basic tests/test_generics.py::test_get_caller_frame_info tests/test_generics.py::test_get_caller_frame_info_called_from_module tests/test_generics.py::test_get_caller_frame_info_when_sys_getframe_undefined tests/test_generics.py::test_iter_contained_typevars tests/test_generics.py::test_nested_identity_parameterization tests/test_generics.py::test_replace_types tests/test_generics.py::test_replace_types_with_user_defined_generic_type_field tests/test_generics.py::test_replace_types_identity_on_unchanged tests/test_generics.py::test_deep_generic tests/test_generics.py::test_deep_generic_with_inner_typevar tests/test_generics.py::test_deep_generic_with_referenced_generic tests/test_generics.py::test_deep_generic_with_referenced_inner_generic tests/test_generics.py::test_deep_generic_with_multiple_typevars tests/test_generics.py::test_deep_generic_with_multiple_inheritance tests/test_generics.py::test_generic_with_referenced_generic_type_1 tests/test_generics.py::test_generic_with_referenced_nested_typevar tests/test_generics.py::test_generic_with_callable tests/test_generics.py::test_generic_with_partial_callable tests/test_generics.py::test_generic_recursive_models tests/test_generics.py::test_generic_enum tests/test_generics.py::test_generic_literal tests/test_generics.py::test_generic_enums tests/test_generics.py::test_generic_with_user_defined_generic_field tests/test_generics.py::test_generic_annotated tests/test_generics.py::test_generic_subclass tests/test_generics.py::test_generic_subclass_with_partial_application tests/test_generics.py::test_multilevel_generic_binding tests/test_generics.py::test_generic_subclass_with_extra_type tests/test_generics.py::test_multi_inheritance_generic_binding tests/test_generics.py::test_parse_generic_json