diff --git a/doc/data/messages/l/literal-comparison/bad.py b/doc/data/messages/l/literal-comparison/bad.py new file mode 100644 index 0000000000..d85667b7e4 --- /dev/null +++ b/doc/data/messages/l/literal-comparison/bad.py @@ -0,0 +1,2 @@ +def is_an_orange(fruit): + return fruit is "orange" # [literal-comparison] diff --git a/doc/data/messages/l/literal-comparison/good.py b/doc/data/messages/l/literal-comparison/good.py new file mode 100644 index 0000000000..786aeaf2a2 --- /dev/null +++ b/doc/data/messages/l/literal-comparison/good.py @@ -0,0 +1,2 @@ +def is_an_orange(fruit): + return fruit == "orange" diff --git a/doc/data/messages/l/literal-comparison/related.rst b/doc/data/messages/l/literal-comparison/related.rst new file mode 100644 index 0000000000..5a95db4f3c --- /dev/null +++ b/doc/data/messages/l/literal-comparison/related.rst @@ -0,0 +1 @@ +* `Comparison operations in Python `_