-
Notifications
You must be signed in to change notification settings - Fork 110
Description
When upgrading, some false positives were found for B023 (implimented in #265).
Example
"""B023.py"""
def filter_values(values: list[list[int]], max_percentage: float):
for value in values:
filter_val = max(value) * max_percentage
yield list(filter(lambda x: x < filter_val, value))
$ flake8 B023.py
bugbear_me.py:4:41: B023 Function definition does not bind loop variable 'filter_val' is valid, and doesn't fall into the
A silly example here, but one where the use of filter_val
is valid.
cc @Zac-HD
In the PR you mentioned some hard to detect false positives that you were okay with. Was this kind of pattern one of the ones you had in mind?
Thanks for this check btw, I think it's a good idea. I've fallen for this in the past!
gladykov, ankush, joouha and elonzh
Metadata
Metadata
Assignees
Labels
No labels