From 6e7a6b492a243ffe12c583139e05262181f64fe5 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sat, 29 Mar 2025 21:03:00 +0300 Subject: [PATCH 1/3] Update returns_plugin.py --- returns/contrib/mypy/returns_plugin.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/returns/contrib/mypy/returns_plugin.py b/returns/contrib/mypy/returns_plugin.py index e50df9a3e..0d6e508e4 100644 --- a/returns/contrib/mypy/returns_plugin.py +++ b/returns/contrib/mypy/returns_plugin.py @@ -12,7 +12,7 @@ """ 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 ( @@ -39,22 +39,22 @@ # ============ #: Type for a function hook. -_FunctionCallback = Callable[[FunctionContext], MypyType] +_FunctionCallback: TypeAlias = Callable[[FunctionContext], MypyType] #: Type for a function hook that need a definition node. -_FunctionDefCallback = Callable[ +_FunctionDefCallback: TypeAlias = Callable[ [SymbolTableNode | None], 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 From 0d5062846ece8b2c8a137e9a3ee26b047b75c9d2 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sat, 29 Mar 2025 21:07:48 +0300 Subject: [PATCH 2/3] Update returns_plugin.py --- returns/contrib/mypy/returns_plugin.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/returns/contrib/mypy/returns_plugin.py b/returns/contrib/mypy/returns_plugin.py index 0d6e508e4..0fca77579 100644 --- a/returns/contrib/mypy/returns_plugin.py +++ b/returns/contrib/mypy/returns_plugin.py @@ -41,12 +41,6 @@ #: Type for a function hook. _FunctionCallback: TypeAlias = Callable[[FunctionContext], MypyType] -#: Type for a function hook that need a definition node. -_FunctionDefCallback: TypeAlias = Callable[ - [SymbolTableNode | None], - Callable[[FunctionContext], MypyType], -] - #: Type for attribute hook. _AttributeCallback: TypeAlias = Callable[[AttributeContext], MypyType] From 5ca23a1cc80fea05ec08182da05369dbaf64126b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 29 Mar 2025 18:07:56 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks --- returns/contrib/mypy/returns_plugin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/returns/contrib/mypy/returns_plugin.py b/returns/contrib/mypy/returns_plugin.py index 0fca77579..4831de529 100644 --- a/returns/contrib/mypy/returns_plugin.py +++ b/returns/contrib/mypy/returns_plugin.py @@ -14,7 +14,6 @@ from collections.abc import Callable, Mapping from typing import ClassVar, TypeAlias, final -from mypy.nodes import SymbolTableNode from mypy.plugin import ( AttributeContext, FunctionContext,