-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[use-implicit-booleaness-not-comparison] Add an example of good and b…
…ad code
- Loading branch information
1 parent
f5f9e26
commit 8d03101
Showing
3 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
doc/data/messages/u/use-implicit-booleaness-not-comparison/bad.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
z = [] | ||
|
||
if z != []: # [use-implicit-booleaness-not-comparison] | ||
print("z is not an empty sequence") |
1 change: 0 additions & 1 deletion
1
doc/data/messages/u/use-implicit-booleaness-not-comparison/details.rst
This file was deleted.
Oops, something went wrong.
5 changes: 4 additions & 1 deletion
5
doc/data/messages/u/use-implicit-booleaness-not-comparison/good.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
# This is a placeholder for correct code for this message. | ||
z = [] | ||
|
||
if z: | ||
print("z is not an empty sequence") |