[perflint] - Fix manual-list-comprehension for async generators (PERF401)#14551
Closed
diceroll123 wants to merge 2 commits intoastral-sh:mainfrom
Closed
[perflint] - Fix manual-list-comprehension for async generators (PERF401)#14551diceroll123 wants to merge 2 commits intoastral-sh:mainfrom
perflint] - Fix manual-list-comprehension for async generators (PERF401)#14551diceroll123 wants to merge 2 commits intoastral-sh:mainfrom
Conversation
Contributor
|
Contributor
Author
|
Found a weird issue with comments, this was already present in the autofix in |
Contributor
|
@w0nder1ng Another edge case. May want to merge this PR with #14369 |
Contributor
Author
|
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 |
Member
|
@diceroll123 #14369 is now merged. Would you mind rebasing your PR? |
d5523a0 to
aafe95f
Compare
Contributor
Author
|
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! 😄 |
Member
|
Thank you and sorry for the rebase struggles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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