-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[perflint] - Fix manual-list-comprehension for async generators (PERF401)
#14551
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
Conversation
|
|
Found a weird issue with comments, this was already present in the autofix in |
|
@w0nder1ng Another edge case. May want to merge this PR with #14369 |
|
Hm, yeah, my implementation does not do well with this one: def f():
# make sure that `tmp` is not deleted
tmp = 1; result = [] # commment should be protected
for i in range(10):
result.append(i + 1) # PERF401 |
|
@diceroll123 #14369 is now merged. Would you mind rebasing your PR? |
MichaReiser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs rebase
d5523a0 to
aafe95f
Compare
|
Woop, destroyed the commit here by accident, but after fixing it locally and coming back from rebase hell, it turns out all of the issues my PR solved were solved by 14369, so I'll close this. Thanks all! 😄 |
|
Thank you and sorry for the rebase struggles |
Summary
Fixes a current bug in PERF401's preview autofix, where it tries to make an async generator within a list.extend, without wrapping the generator in a list, which does not implement
__iter__which makes it an error.Test Plan
cargo test