From f468b5d35f933ef84a12e00ef405ce13817deaa6 Mon Sep 17 00:00:00 2001 From: Matus Valo Date: Sun, 3 Apr 2022 23:29:28 +0200 Subject: [PATCH] Added comparison-with-itself message example (#6157) Co-authored-by: Vladyslav Krylasov Co-authored-by: Pierre Sassoulas --- doc/data/messages/c/comparison-with-itself/bad.py | 3 +++ doc/data/messages/c/comparison-with-itself/good.py | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 doc/data/messages/c/comparison-with-itself/bad.py create mode 100644 doc/data/messages/c/comparison-with-itself/good.py diff --git a/doc/data/messages/c/comparison-with-itself/bad.py b/doc/data/messages/c/comparison-with-itself/bad.py new file mode 100644 index 0000000000..77794bc5c9 --- /dev/null +++ b/doc/data/messages/c/comparison-with-itself/bad.py @@ -0,0 +1,3 @@ +def is_an_orange(fruit): + an_orange = "orange" + return fruit == fruit # [comparison-with-itself] diff --git a/doc/data/messages/c/comparison-with-itself/good.py b/doc/data/messages/c/comparison-with-itself/good.py new file mode 100644 index 0000000000..b2b4296502 --- /dev/null +++ b/doc/data/messages/c/comparison-with-itself/good.py @@ -0,0 +1,3 @@ +def is_an_orange(fruit): + an_orange = "orange" + return an_orange == fruit