diff --git a/mypy/plugins/default.py b/mypy/plugins/default.py index a7d1c9e4426ab..67352a05e4474 100644 --- a/mypy/plugins/default.py +++ b/mypy/plugins/default.py @@ -67,7 +67,6 @@ TPDICT_FB_NAMES, AnyType, CallableType, - FunctionLike, Instance, LiteralType, NoneType, @@ -111,7 +110,7 @@ def get_function_hook(self, fullname: str) -> Callable[[FunctionContext], Type] def get_function_signature_hook( self, fullname: str - ) -> Callable[[FunctionSigContext], FunctionLike] | None: + ) -> Callable[[FunctionSigContext], CallableType] | None: if fullname in ("attr.evolve", "attrs.evolve", "attr.assoc", "attrs.assoc"): return evolve_function_sig_callback elif fullname in ("attr.fields", "attrs.fields"): @@ -122,7 +121,7 @@ def get_function_signature_hook( def get_method_signature_hook( self, fullname: str - ) -> Callable[[MethodSigContext], FunctionLike] | None: + ) -> Callable[[MethodSigContext], CallableType] | None: if fullname == "typing.Mapping.get": return typed_dict_get_signature_callback elif fullname in TD_SETDEFAULT_NAMES: diff --git a/mypy/plugins/singledispatch.py b/mypy/plugins/singledispatch.py index 9a5576c17e82c..ab47d2d034d13 100644 --- a/mypy/plugins/singledispatch.py +++ b/mypy/plugins/singledispatch.py @@ -13,7 +13,6 @@ from mypy.types import ( AnyType, CallableType, - FunctionLike, Instance, NoneType, Overloaded, @@ -203,7 +202,7 @@ def call_singledispatch_function_after_register_argument(ctx: MethodContext) -> return ctx.default_return_type -def call_singledispatch_function_callback(ctx: MethodSigContext) -> FunctionLike: +def call_singledispatch_function_callback(ctx: MethodSigContext) -> CallableType: """Called for functools._SingleDispatchCallable.__call__""" if not isinstance(ctx.type, Instance): return ctx.default_signature