diff options
Diffstat (limited to 'pylint/checkers/variables.py')
-rw-r--r-- | pylint/checkers/variables.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index a32099dfd..8bfdc197e 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -63,7 +63,7 @@ import re import sys from enum import Enum from functools import lru_cache -from typing import Any, DefaultDict, List, Optional, Set, Tuple, Union +from typing import TYPE_CHECKING, Any, DefaultDict, List, Optional, Set, Tuple, Union import astroid from astroid import nodes @@ -74,6 +74,9 @@ from pylint.constants import PY39_PLUS from pylint.interfaces import HIGH, INFERENCE, INFERENCE_FAILURE, IAstroidChecker from pylint.utils import get_global_option +if TYPE_CHECKING: + from pylint.lint import PyLinter + if sys.version_info >= (3, 8): from typing import Literal else: @@ -2527,6 +2530,5 @@ class VariablesChecker(BaseChecker): return consumed -def register(linter): - """required method to auto register this checker""" +def register(linter: "PyLinter") -> None: linter.register_checker(VariablesChecker(linter)) |