diff options
| author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2023-04-23 23:53:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-23 23:53:59 +0200 |
| commit | a91a8d60ccd5ca8e5f8e162d67b3b93444105235 (patch) | |
| tree | 7087fd6ddbabfc81f99627f1122f8092bec977fc /astroid/nodes/node_classes.py | |
| parent | e49bfaa2229e2ce27b7a212ad3ebe378dc17f613 (diff) | |
| download | astroid-git-a91a8d60ccd5ca8e5f8e162d67b3b93444105235.tar.gz | |
Drop support for Python 3.7 (#2137)
Diffstat (limited to 'astroid/nodes/node_classes.py')
| -rw-r--r-- | astroid/nodes/node_classes.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py index 2f29355d..c9221e14 100644 --- a/astroid/nodes/node_classes.py +++ b/astroid/nodes/node_classes.py @@ -8,12 +8,20 @@ from __future__ import annotations import abc import itertools -import sys import typing import warnings from collections.abc import Generator, Iterable, Iterator, Mapping -from functools import lru_cache -from typing import TYPE_CHECKING, Any, Callable, ClassVar, Optional, TypeVar, Union +from functools import cached_property, lru_cache +from typing import ( + TYPE_CHECKING, + Any, + Callable, + ClassVar, + Literal, + Optional, + TypeVar, + Union, +) from astroid import decorators, util from astroid.bases import Instance, _infer_stmts @@ -39,20 +47,10 @@ from astroid.typing import ( SuccessfulInferenceResult, ) -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - if TYPE_CHECKING: from astroid import nodes from astroid.nodes import LocalsDictNodeNG -if sys.version_info >= (3, 8): - from functools import cached_property -else: - from astroid.decorators import cachedproperty as cached_property - def _is_const(value) -> bool: return isinstance(value, tuple(CONST_CLS)) @@ -354,7 +352,7 @@ class BaseContainer(_base_nodes.ParentAssignNode, Instance, metaclass=abc.ABCMet class LookupMixIn(NodeNG): """Mixin to look up a name in the right scope.""" - @lru_cache() # noqa + @lru_cache # noqa def lookup(self, name: str) -> tuple[LocalsDictNodeNG, list[NodeNG]]: """Lookup where the given variable is assigned. |
