diff --git a/returns/contrib/mypy/returns_plugin.py b/returns/contrib/mypy/returns_plugin.py index e50df9a3e..4831de529 100644 --- a/returns/contrib/mypy/returns_plugin.py +++ b/returns/contrib/mypy/returns_plugin.py @@ -12,9 +12,8 @@ """ from collections.abc import Callable, Mapping -from typing import ClassVar, final +from typing import ClassVar, TypeAlias, final -from mypy.nodes import SymbolTableNode from mypy.plugin import ( AttributeContext, FunctionContext, @@ -39,22 +38,16 @@ # ============ #: Type for a function hook. -_FunctionCallback = Callable[[FunctionContext], MypyType] - -#: Type for a function hook that need a definition node. -_FunctionDefCallback = Callable[ - [SymbolTableNode | None], - Callable[[FunctionContext], MypyType], -] +_FunctionCallback: TypeAlias = Callable[[FunctionContext], MypyType] #: Type for attribute hook. -_AttributeCallback = Callable[[AttributeContext], MypyType] +_AttributeCallback: TypeAlias = Callable[[AttributeContext], MypyType] #: Type for a method hook. -_MethodCallback = Callable[[MethodContext], MypyType] +_MethodCallback: TypeAlias = Callable[[MethodContext], MypyType] #: Type for a method signature hook. -_MethodSigCallback = Callable[[MethodSigContext], CallableType] +_MethodSigCallback: TypeAlias = Callable[[MethodSigContext], CallableType] # Interface