summaryrefslogtreecommitdiff
path: root/pylint/typing.py
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2022-04-18 17:41:07 +0200
committerGitHub <noreply@github.com>2022-04-18 17:41:07 +0200
commit68e9ab5ff4d4b59e0006b325112d3b78e22dd154 (patch)
tree8ed912b3bcdc6fa3665ec14e2756071c2e582124 /pylint/typing.py
parente5dfec0127e342eac8bdb46b1ecd8483b39c6049 (diff)
downloadpylint-git-68e9ab5ff4d4b59e0006b325112d3b78e22dd154.tar.gz
Add last typing to ``pylint/utils`` (#6369)
Diffstat (limited to 'pylint/typing.py')
-rw-r--r--pylint/typing.py12
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."""