Skip to content
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

B020 Bug #262

Closed
btjones0 opened this issue Jun 16, 2022 · 5 comments
Closed

B020 Bug #262

btjones0 opened this issue Jun 16, 2022 · 5 comments

Comments

@btjones0
Copy link

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.

@cooperlees
Copy link
Collaborator

cooperlees commented Jun 23, 2022

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):

@FozzieHi
Copy link
Contributor

@cooperlees Seems to be fixed now so can be closed 👍

@cooperlees
Copy link
Collaborator

Thanks! Do we know the PR or how did you test it to see it pass?

@FozzieHi
Copy link
Contributor

@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.

@cooperlees
Copy link
Collaborator

Many thanks explaining in case someone disagrees in the future with us for closing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants