C413 fix for reversed(sorted(..., reverse=...)) needs parentheses when key is a boolop to avoid changing semantics #10335
Labels
bug
Something isn't working
fixes
Related to suggested fixes for violations
help wanted
Contributions especially welcome
Due to https://docs.python.org/3/reference/expressions.html#operator-precedence
This affects boolean operators and if-expr's. Higher-precedented operators won't need parens added, walruses need to be wrapped in parens in the original statement, and lambda's are invalid in this context.
command invocation & version
The text was updated successfully, but these errors were encountered: