-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improvements to RUF015 #7848
Improvements to RUF015 #7848
Conversation
PR Check ResultsEcosystem✅ ecosystem check detected no changes. |
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.
Looks great, made a few small changes!
false | ||
}; | ||
IterationTarget { | ||
range: value.range(), |
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.
I think we can just use the range of the value here. (The previous logic would have failed if there was, e.g., space between the bracket and the star.)
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.
I did not think of that...
I was inspired by the logic done for the Expr::ListComp
above.
## Summary Resolves #7618. The list of builtin iterator is not exhaustive. ## Test Plan `cargo test` ``` python a = [1, 2] examples = [ enumerate(a), filter(lambda x: x, a), map(int, a), reversed(a), zip(a), iter(a), ] for example in examples: print(next(example)) ```
Summary
Resolves #7618.
The list of builtin iterator is not exhaustive.
Test Plan
cargo test