def is_callable_type(tp):
if NEW_TYPING:<EOL><INDENT>return (tp is Callable or isinstance(tp, _GenericAlias) and<EOL>tp.__origin__ is collections.abc.Callable or<EOL>isinstance(tp, type) and issubclass(tp, Generic) and<EOL>issubclass(tp, collections.abc.Callable))<EOL><DEDENT>return type(tp) is CallableMeta<EOL>
Test if the type is a generic callable type, including subclasses
    excluding non-generic types and callables.
    Examples::

        is_callable_type(int) == False
        is_callable_type(type) == False
        is_callable_type(Callable) == True
        is_callable_type(Callable[..., int]) == True
        is_callable_type(Callable[[int, int], Iterable[str]]) == True
        class MyClass(Callable[[int], int]):
            ...
        is_callable_type(MyClass) == True

    For more general tests use callable(), for more precise test
    (excluding subclasses) use::

        get_origin(tp) is collections.abc.Callable  # Callable prior to Python 3.7