Skip to content

Commit

Permalink
Remove BOOL_SPECIAL_METHOD
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Apr 23, 2023
1 parent 48054ce commit 952868b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 8 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@ Release date: TBA

Refs #1490

* Remove ``astroid.const.PY38_PLUS`` and the previously deprecated ``astroid.const.BUILTINS``,
``astroid.bases.BUILTINS``, as well as ``astroid.const.Load``, ``..Store``, and ``..Del``.
* Remove unused and / or deprecated constants:
- ``astroid.bases.BOOL_SPECIAL_METHOD``
- ``astroid.bases.BUILTINS``
- ``astroid.const.BUILTINS``
- ``astroid.const.PY38_PLUS``
- ``astroid.const.Load``
- ``astroid.const.Store``
- ``astroid.const.Del``

Refs #2141

Expand Down
5 changes: 1 addition & 4 deletions astroid/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
from astroid.constraint import Constraint


# TODO: check if needs special treatment
BOOL_SPECIAL_METHOD = "__bool__"

PROPERTIES = {"builtins.property", "abc.abstractproperty"}
if PY310_PLUS:
PROPERTIES.add("enum.property")
Expand Down Expand Up @@ -382,7 +379,7 @@ def bool_value(
context.boundnode = self

try:
result = _infer_method_result_truth(self, BOOL_SPECIAL_METHOD, context)
result = _infer_method_result_truth(self, "__bool__", context)
except (InferenceError, AttributeInferenceError):
# Fallback to __len__.
try:
Expand Down

0 comments on commit 952868b

Please sign in to comment.