From 96d7e898cc863a6854cd0870ba4069c8f7d7851b Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sat, 26 Mar 2022 18:31:49 -0400 Subject: Fix false positive for `superfluous-parens` for `return (a or b) in iterable` (#5964) Co-authored-by: Pierre Sassoulas --- tests/functional/s/superfluous_parens.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/functional/s') 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 -- cgit v1.2.1