-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow additional arguments for sum and max comprehensions (#12364)
## Summary These can have other arguments, so it seems wrong to gate on single argument here. Closes #12358.
- Loading branch information
1 parent
648cca1
commit 9b9d701
Showing
5 changed files
with
43 additions
and
17 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
crates/ruff_linter/resources/test/fixtures/flake8_comprehensions/C419_1.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
sum([x.val for x in bar]) | ||
min([x.val for x in bar]) | ||
max([x.val for x in bar]) | ||
sum([x.val for x in bar], 0) | ||
|
||
# Ok | ||
sum(x.val for x in bar) | ||
min(x.val for x in bar) | ||
max(x.val for x in bar) | ||
sum(x.val for x in bar, 0) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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