New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
superfluous-parens in if-expression are not superfluous #2818
Comments
andreasvc
changed the title
superfluous-parents which are not superfluous
superfluous-parens in if-expression are not superfluous
Mar 18, 2019
Thanks @andreasvc for reporting this issue. |
I'm also having this bug in an expression that matches @andreasvc's pattern: rec["answers"] = [elt.lower() for elt in (rec["answers"] if rec["answers"] else [])] |
DanielNoord
added a commit
to DanielNoord/pylint
that referenced
this issue
Aug 1, 2021
This fixes the false positives identified in pylint-dev#2818, pylint-dev#3249, pylint-dev#3608 & pylint-dev#4346 All false positives reported fell under keywords before walrus operator or if-keyword within generators/comprehension. This closes pylint-dev#2818, closes pylint-dev#3429, closes pylint-dev#3608, closes pylint-dev#4346
4 tasks
DanielNoord
added a commit
to DanielNoord/pylint
that referenced
this issue
Aug 1, 2021
This fixes the false positives identified in pylint-dev#2818, pylint-dev#3249, pylint-dev#3608 & pylint-dev#4346 All false positives reported fell under keywords before walrus operator or if-keyword within generators/comprehension. This closes pylint-dev#2818, closes pylint-dev#3429, closes pylint-dev#3608, closes pylint-dev#4346
DanielNoord
added a commit
to DanielNoord/pylint
that referenced
this issue
Aug 1, 2021
This fixes the false positives identified in pylint-dev#2818, pylint-dev#3249, pylint-dev#3608 & pylint-dev#4346 All false positives reported fell under keywords before walrus operator or if-keyword within generators/comprehension. This closes pylint-dev#2818, closes pylint-dev#3429, closes pylint-dev#3608, closes pylint-dev#4346
Pierre-Sassoulas
added a commit
that referenced
this issue
Aug 3, 2021
* Split functional tests for ``superfluous-parents`` * Fix false positives for superfluous-parens This fixes the false positives identified in #2818, #3249, #3608 & #4346 All false positives reported fell under keywords before walrus operator or if-keyword within generators/comprehension. This closes #2818, closes #3429, closes #3608, closes #4346 * Move the superfluous functional tests to functional/s/super Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Create file t.py:
Related to #574 but this example has an if-expression instead of short circut.
Current behavior
Note that following this suggestion actually creates a SyntaxError:
Expected behavior
This warning is not emitted in this case.
pylint --version output
The text was updated successfully, but these errors were encountered: