-
Notifications
You must be signed in to change notification settings - Fork 882
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refurb] Implement
reimplemented-starmap
rule (FURB140
)
- Loading branch information
1 parent
9cb5ce7
commit 1ab6401
Showing
8 changed files
with
532 additions
and
16 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
def zipped(): | ||
return zip([1, 2, 3], "ABC") | ||
|
||
# Errors. | ||
|
||
# FURB140 | ||
[print(x, y) for x, y in zipped()] | ||
|
||
# FURB140 | ||
(print(x, y) for x, y in zipped()) | ||
|
||
# FURB140 | ||
{print(x, y) for x, y in zipped()} | ||
|
||
|
||
from itertools import starmap as sm | ||
|
||
# FURB140 | ||
[print(x, y) for x, y in zipped()] | ||
|
||
# FURB140 | ||
(print(x, y) for x, y in zipped()) | ||
|
||
# FURB140 | ||
{print(x, y) for x, y in zipped()} | ||
|
||
# Non-errors. | ||
|
||
[print(x, int) for x, _ in zipped()] | ||
|
||
[print(x, y, 1) for x, y in zipped()] | ||
|
||
[print(y, x) for x, y in zipped()] | ||
|
||
[print(x + 1, y) for x, y in zipped()] | ||
|
||
[print(x) for x in range(100)] | ||
|
||
[print() for x, y in zipped()] | ||
|
||
[print(x, end=y) for x, y in zipped()] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
pub(crate) use check_and_remove_from_set::*; | ||
pub(crate) use delete_full_slice::*; | ||
pub(crate) use reimplemented_starmap::*; | ||
pub(crate) use repeated_append::*; | ||
|
||
mod check_and_remove_from_set; | ||
mod delete_full_slice; | ||
mod reimplemented_starmap; | ||
mod repeated_append; |
Oops, something went wrong.