flake8-bugbear
flake8-bugbear copied to clipboard
B020 Bug
This is similar to #235 but with sort keys.
for student in sorted(students, key=lambda student: student.last_name):
...
results in B020 but it seems like it should be fine.
Yeah, I agree if we can find a way to see the scope of student in the lambda I'd happy take that PR.
On the contrary, I do argue tho, it would do nothing but help readability to not use the variable name student in the lambda.
for student in sorted(students, key=lambda student_to_sort: student_to_sort.last_name):
@cooperlees Seems to be fixed now so can be closed :+1:
Thanks! Do we know the PR or how did you test it to see it pass?
@cooperlees Just copied the example above and ran flake8 on it.
Looks like this issue is actually a duplicate of #256 which was fixed in #259 although was not actually released when this issue was made. With git checkout b1e4ef296ec6afb6df788d81db0953cf5fd79566~1 the issue is there, and with git checkout b1e4ef296ec6afb6df788d81db0953cf5fd79566 the issue is fixed.
Many thanks explaining in case someone disagrees in the future with us for closing this!