PERF401 is triggered on for-loops that has the walrus operator inside #15047
Labels
bug
Something isn't working
documentation
Improvements or additions to documentation
fixes
Related to suggested fixes for violations
PERF401 is triggered on code that has the walrus operator inside. The walrus operator is not available in the list-comprehension if-shorthand and it can not be recreated within a single list-comprehension.
Minimal example
This code can obviously be refactored to not include the walrus operator but there are more complex scenarios where it is impossible to do so without using multiple list-comprehensions or duplicating code.
More complex example
The text was updated successfully, but these errors were encountered: