From 1ba3f141922c9f09feb4fb4eb9c561d38f4381d1 Mon Sep 17 00:00:00 2001 From: Andrew Haigh Date: Mon, 14 Jun 2021 07:52:13 +1000 Subject: [PATCH 1/2] Add enum.property class descriptor to _is_property Ref PyCQA/pylint#2306. Added in Python 3.10 --- astroid/bases.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 From 23d85b045b0d0ddeddb746c17dfbe2e0fc9b7f42 Mon Sep 17 00:00:00 2001 From: Andrew Haigh Date: Mon, 14 Jun 2021 07:54:51 +1000 Subject: [PATCH 2/2] Update changelog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) 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