diff --git a/ChangeLog b/ChangeLog index b243da88f8..1d13c38408 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ Release Date: TBA Closes PyCQA/pylint#1932 Closes PyCQA/pylint#2062 + Closes PyCQA/pylint#2306 * Removed ``Repr``, ``Exec``, and ``Print`` nodes as the ``ast`` nodes they represented have been removed with the change to Python 3 diff --git a/astroid/bases.py b/astroid/bases.py index 4cef7546ba..e2d0cfe1d7 100644 --- a/astroid/bases.py +++ b/astroid/bases.py @@ -25,6 +25,7 @@ import builtins import collections +import sys from astroid import context as contextmod from astroid import exceptions, util @@ -35,11 +36,16 @@ 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