Skip to content

Commit 422b52c

Browse files
Update returns_plugin.py (#2088)
* Update returns_plugin.py * Update returns_plugin.py * [pre-commit.ci] auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f50f4ff commit 422b52c

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

returns/contrib/mypy/returns_plugin.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
"""
1313

1414
from collections.abc import Callable, Mapping
15-
from typing import ClassVar, final
15+
from typing import ClassVar, TypeAlias, final
1616

17-
from mypy.nodes import SymbolTableNode
1817
from mypy.plugin import (
1918
AttributeContext,
2019
FunctionContext,
@@ -39,22 +38,16 @@
3938
# ============
4039

4140
#: Type for a function hook.
42-
_FunctionCallback = Callable[[FunctionContext], MypyType]
43-
44-
#: Type for a function hook that need a definition node.
45-
_FunctionDefCallback = Callable[
46-
[SymbolTableNode | None],
47-
Callable[[FunctionContext], MypyType],
48-
]
41+
_FunctionCallback: TypeAlias = Callable[[FunctionContext], MypyType]
4942

5043
#: Type for attribute hook.
51-
_AttributeCallback = Callable[[AttributeContext], MypyType]
44+
_AttributeCallback: TypeAlias = Callable[[AttributeContext], MypyType]
5245

5346
#: Type for a method hook.
54-
_MethodCallback = Callable[[MethodContext], MypyType]
47+
_MethodCallback: TypeAlias = Callable[[MethodContext], MypyType]
5548

5649
#: Type for a method signature hook.
57-
_MethodSigCallback = Callable[[MethodSigContext], CallableType]
50+
_MethodSigCallback: TypeAlias = Callable[[MethodSigContext], CallableType]
5851

5952

6053
# Interface

0 commit comments

Comments
 (0)