mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-24 14:17:41 -05:00
pylint: Skip use-implicit-booleaness-not-comparison
Pylint 2.12.0 introduced new checker:
> Used when Pylint detects that collection literal comparison is being
used to check for emptiness; Use implicit booleaness insteadof a
collection classes; empty collections are considered as false
Comparison of variable to equality to collection:
> Lexicographical comparison between built-in collections works as follows:
For two collections to compare equal, they must be of the same type,
have the same length, and each pair of corresponding elements must
compare equal (for example, [1,2] == (1,2) is false because the type is
not the same).
Collections that support order comparison are ordered the same as their
first unequal elements (for example, [1,2,x] <= [1,2,y] has the same
value as x <= y). If a corresponding element does not exist, the shorter
collection is ordered first (for example, [1,2] < [1,2,3] is true).
So, `assert value == {}` is not the same as `assert not value`.
Fixes: https://pagure.io/freeipa/issue/9117
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
1 parent
2db2c6cb32
commit
03cd914381
1 file changed
+1
@@ -121,6 +121,7 @@ disable=
|
||||
use-dict-literal, # pylint 2.10.0 dict vs {}
|
||||
use-list-literal, # pylint 2.10.0 list() vs []
|
||||
unspecified-encoding, # pylint 2.10.0, ASCII or UTF8 and platform-specific
|
||||
use-implicit-booleaness-not-comparison, # pylint 2.12.2, weak comparison
|
||||
|
||||
[REPORTS]
|
||||
|
||||
|
||||
Reference in new issue
Block a user