|
7 | 7 | from __future__ import annotations |
8 | 8 |
|
9 | 9 | from collections import defaultdict |
10 | | -from collections.abc import Callable, Sequence |
11 | 10 | from functools import cached_property |
12 | 11 | from itertools import chain, zip_longest |
13 | | -from re import Pattern |
14 | | -from typing import TYPE_CHECKING, Any, NamedTuple, Union |
| 12 | +from typing import TYPE_CHECKING, NamedTuple |
15 | 13 |
|
16 | 14 | import astroid |
17 | | -from astroid import bases, nodes, util |
18 | | -from astroid.nodes import LocalsDictNodeNG |
19 | | -from astroid.typing import SuccessfulInferenceResult |
| 15 | +from astroid import nodes, util |
20 | 16 |
|
21 | 17 | from pylint.checkers import BaseChecker, utils |
22 | 18 | from pylint.checkers.utils import ( |
|
40 | 36 | uninferable_final_decorators, |
41 | 37 | ) |
42 | 38 | from pylint.interfaces import HIGH, INFERENCE |
43 | | -from pylint.typing import MessageDefinitionTuple |
44 | 39 |
|
45 | 40 | if TYPE_CHECKING: |
| 41 | + from collections.abc import Callable, Sequence |
| 42 | + from re import Pattern |
| 43 | + from typing import Any, Union |
| 44 | + |
| 45 | + from astroid import bases |
| 46 | + from astroid.nodes import LocalsDictNodeNG |
| 47 | + from astroid.typing import SuccessfulInferenceResult |
| 48 | + |
46 | 49 | from pylint.lint.pylinter import PyLinter |
| 50 | + from pylint.typing import MessageDefinitionTuple |
47 | 51 |
|
| 52 | + _AccessNodes = Union[nodes.Attribute, nodes.AssignAttr] |
48 | 53 |
|
49 | | -_AccessNodes = Union[nodes.Attribute, nodes.AssignAttr] |
50 | 54 |
|
51 | 55 | INVALID_BASE_CLASSES = {"bool", "range", "slice", "memoryview"} |
52 | 56 | ALLOWED_PROPERTIES = {"bultins.property", "functools.cached_property"} |
|
0 commit comments