Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/pylint2036 enum py310 #1028

Merged
merged 2 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions astroid/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import builtins
import collections
import sys

from astroid import context as contextmod
from astroid import exceptions, util
Expand All @@ -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
Expand Down