Skip to content

Commit 74ff4c5

Browse files
[doc] Add warning for empty sequences in 'use-implicit-booleaness-not-comparison'
1 parent 918f462 commit 74ff4c5

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Following this check blindly in weakly typed code base can create hard to debug issues. If the value
2-
can be something else that is falsey but not a string (for example ``None``, or ``0``), the code will
3-
not be equivalent.
2+
can be something else that is falsey but not a string (for example ``None``, an empty sequence, or ``0``),
3+
the code will not be equivalent.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Following this check blindly in weakly typed code base can create hard to debug issues. If the value
2-
can be something else that is falsey but not an ``int`` (for example ``None``, or an empty string),
3-
the code will not be equivalent.
2+
can be something else that is falsey but not an ``int`` (for example ``None``, an empty sequence,
3+
or an empty string), the code will not be equivalent.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Following this check blindly in weakly typed code base can create hard to debug issues. If the value
2+
can be something else that is falsey but not a sequence (for example ``None``, an empty string, or ``0``),
3+
the code will not be equivalent.

doc/whatsnew/fragments/6871.user_action

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
* The compare to empty string checker (``pylint.extensions.emptystring``) and the compare to
2-
zero checker (``pylint.extensions.compare-to-zero``) have been removed and their checks are
3-
now part of the implicit booleaness checker:
4-
5-
- ``compare-to-zero`` was renamed ``use-implicit-booleaness-not-comparison-to-zero``
6-
and ``compare-to-empty-string`` was renamed ``use-implicit-booleaness-not-comparison-to-string``
7-
and they now need to be enabled explicitly.
8-
- The `pylint.extensions.emptystring`` and ``pylint.extensions.compare-to-zero`` extensions no longer exists and
9-
needs to be removed from the ``load-plugins`` option.
1+
The compare to empty string checker (``pylint.extensions.emptystring``) and the compare to
2+
zero checker (``pylint.extensions.compare-to-zero``) have been removed and their checks are
3+
now part of the implicit booleaness checker:
4+
5+
``compare-to-zero`` was renamed ``use-implicit-booleaness-not-comparison-to-zero`` and
6+
``compare-to-empty-string`` was renamed ``use-implicit-booleaness-not-comparison-to-string``
7+
and they now need to be enabled explicitly.
8+
9+
The `pylint.extensions.emptystring`` and ``pylint.extensions.compare-to-zero`` extensions
10+
no longer exists and needs to be removed from the ``load-plugins`` option.
1011

1112
This permits to make their likeness explicit and will provide better performance as they share most of their
1213
conditions to be raised.

0 commit comments

Comments
 (0)