summaryrefslogtreecommitdiff
path: root/astroid
diff options
context:
space:
mode:
authorAndrew Haigh <hello@nelf.in>2021-06-14 15:42:56 +1000
committerGitHub <noreply@github.com>2021-06-14 07:42:56 +0200
commit8757078c17bd06f074e389d3e362e6ba11ef2b59 (patch)
tree37eade1241863b878239097b0e0cdaff7745fb05 /astroid
parent432aa9922abd049077b1beb04414bcccbaa3d277 (diff)
downloadastroid-git-8757078c17bd06f074e389d3e362e6ba11ef2b59.tar.gz
Fix/pylint2036 enum py310 (#1028)
* Add enum.property class descriptor to _is_property Ref PyCQA/pylint#2306. Added in Python 3.10
Diffstat (limited to 'astroid')
-rw-r--r--astroid/bases.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/astroid/bases.py b/astroid/bases.py
index 4cef7546..e2d0cfe1 100644
--- a/astroid/bases.py
+++ b/astroid/bases.py
@@ -25,6 +25,7 @@ inference utils.
import builtins
import collections
+import sys
from astroid import context as contextmod
from astroid import exceptions, util
@@ -35,11 +36,16 @@ BUILTINS = builtins.__name__
manager = util.lazy_import("manager")
MANAGER = manager.AstroidManager()
+PY310 = sys.version_info >= (3, 10)
+
# TODO: check if needs special treatment
BUILTINS = "builtins"
BOOL_SPECIAL_METHOD = "__bool__"
PROPERTIES = {BUILTINS + ".property", "abc.abstractproperty"}
+if PY310:
+ PROPERTIES.add("enum.property")
+
# List of possible property names. We use this list in order
# to see if a method is a property or not. This should be
# pretty reliable and fast, the alternative being to check each