diff options
author | Jacob Walls <jacobtylerwalls@gmail.com> | 2022-03-26 18:31:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-26 23:31:49 +0100 |
commit | 96d7e898cc863a6854cd0870ba4069c8f7d7851b (patch) | |
tree | fc4fa3c0c4639d13c4a02cf9b9d32f97e7cc460f /tests | |
parent | 556304eb1e54c67940d0f9d0497ffa368b50a22a (diff) | |
download | pylint-git-96d7e898cc863a6854cd0870ba4069c8f7d7851b.tar.gz |
Fix false positive for `superfluous-parens` for `return (a or b) in iterable` (#5964)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/s/superfluous_parens.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/functional/s/superfluous_parens.py b/tests/functional/s/superfluous_parens.py index 22c4c3ab4..ee835f6d0 100644 --- a/tests/functional/s/superfluous_parens.py +++ b/tests/functional/s/superfluous_parens.py @@ -44,8 +44,11 @@ def function_A(): def function_B(var): return (var.startswith(('A', 'B', 'C')) or var == 'D') +def function_C(first, second): + return (first or second) in (0, 1) + # TODO: Test string combinations, see https://github.com/PyCQA/pylint/issues/4792 -# Lines 45, 46 & 47 should raise the superfluous-parens message +# The lines with "+" should raise the superfluous-parens message J = "TestString" K = ("Test " + "String") L = ("Test " + "String") in I |