From 5f65700f4e012d8a615874668cebc8a249cb1eda Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Wed, 26 Apr 2023 23:12:18 +0200 Subject: [PATCH] [doc] Add warning for empty sequences in 'use-implicit-booleaness-not-comparison' --- .../details.rst | 3 ++- .../details.rst | 4 ++-- .../u/use-implicit-booleaness-not-comparison/details.rst | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 doc/data/messages/u/use-implicit-booleaness-not-comparison/details.rst diff --git a/doc/data/messages/u/use-implicit-booleaness-not-comparison-to-string/details.rst b/doc/data/messages/u/use-implicit-booleaness-not-comparison-to-string/details.rst index 257fb92bc3e..1e65c620318 100644 --- a/doc/data/messages/u/use-implicit-booleaness-not-comparison-to-string/details.rst +++ b/doc/data/messages/u/use-implicit-booleaness-not-comparison-to-string/details.rst @@ -1,3 +1,4 @@ Following this check blindly in weakly typed code base can create hard to debug issues. If the value -can be something else that is falsey but not a string (for example ``None``, or ``0``), the code will +can be something else that is falsey but not a string (for example ``None``, an empty sequence, or ``0``), +the code will not be equivalent. diff --git a/doc/data/messages/u/use-implicit-booleaness-not-comparison-to-zero/details.rst b/doc/data/messages/u/use-implicit-booleaness-not-comparison-to-zero/details.rst index 670633b2ab9..2f86acf5467 100644 --- a/doc/data/messages/u/use-implicit-booleaness-not-comparison-to-zero/details.rst +++ b/doc/data/messages/u/use-implicit-booleaness-not-comparison-to-zero/details.rst @@ -1,3 +1,3 @@ Following this check blindly in weakly typed code base can create hard to debug issues. If the value -can be something else that is falsey but not an ``int`` (for example ``None``, or an empty string), -the code will not be equivalent. +can be something else that is falsey but not an ``int`` (for example ``None``, an empty sequence, +or an empty string), the code will not be equivalent. diff --git a/doc/data/messages/u/use-implicit-booleaness-not-comparison/details.rst b/doc/data/messages/u/use-implicit-booleaness-not-comparison/details.rst new file mode 100644 index 00000000000..0dc1802459c --- /dev/null +++ b/doc/data/messages/u/use-implicit-booleaness-not-comparison/details.rst @@ -0,0 +1,3 @@ +Following this check blindly in weakly typed code base can create hard to debug issues. If the value +can be something else that is falsey but not a sequence (for example ``None``, an empty string, or ``0``), +the code will not be equivalent.