Skip to content

Commit

Permalink
Added literal-comparison message example (#6159)
Browse files Browse the repository at this point in the history
Co-authored-by: Vladyslav Krylasov <vladyslav.krylasov@gmail.com>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
  • Loading branch information
3 people authored Apr 3, 2022
1 parent 19a3711 commit 6718502
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/data/messages/l/literal-comparison/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def is_an_orange(fruit):
return fruit is "orange" # [literal-comparison]
2 changes: 2 additions & 0 deletions doc/data/messages/l/literal-comparison/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def is_an_orange(fruit):
return fruit == "orange"
1 change: 1 addition & 0 deletions doc/data/messages/l/literal-comparison/related.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* `Comparison operations in Python <https://docs.python.org/3/library/stdtypes.html#comparisons>`_

0 comments on commit 6718502

Please sign in to comment.