diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-04-18 17:41:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-18 17:41:07 +0200 |
commit | 68e9ab5ff4d4b59e0006b325112d3b78e22dd154 (patch) | |
tree | 8ed912b3bcdc6fa3665ec14e2756071c2e582124 /pylint/typing.py | |
parent | e5dfec0127e342eac8bdb46b1ecd8483b39c6049 (diff) | |
download | pylint-git-68e9ab5ff4d4b59e0006b325112d3b78e22dd154.tar.gz |
Add last typing to ``pylint/utils`` (#6369)
Diffstat (limited to 'pylint/typing.py')
-rw-r--r-- | pylint/typing.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pylint/typing.py b/pylint/typing.py index 596b62801..718bb6d3b 100644 --- a/pylint/typing.py +++ b/pylint/typing.py @@ -17,6 +17,7 @@ from typing import ( Pattern, Tuple, Type, + TypeVar, Union, ) @@ -26,6 +27,9 @@ else: from typing_extensions import Literal, TypedDict if TYPE_CHECKING: + from astroid import nodes + + from pylint.checkers import BaseChecker from pylint.config.callback_actions import _CallbackAction @@ -105,3 +109,11 @@ OptionDict = Dict[ ], ] Options = Tuple[Tuple[str, OptionDict], ...] + + +AstCallback = Callable[["nodes.NodeNG"], None] +"""Callable representing a visit or leave function.""" + +CheckerT_co = TypeVar("CheckerT_co", bound="BaseChecker", covariant=True) +AstCallbackMethod = Callable[[CheckerT_co, "nodes.NodeNG"], None] +"""Callable representing a visit or leave method.""" |