-
Notifications
You must be signed in to change notification settings - Fork 1k
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
8d0a5e0
commit 4ec3f0b
Showing
9 changed files
with
557 additions
and
15 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,9 +1,11 @@ | ||
pub(crate) use check_and_remove_from_set::*; | ||
pub(crate) use delete_full_slice::*; | ||
pub(crate) use reimplemented_starmap::*; | ||
pub(crate) use repeated_append::*; | ||
pub(crate) use slice_copy::*; | ||
|
||
mod check_and_remove_from_set; | ||
mod delete_full_slice; | ||
mod reimplemented_starmap; | ||
mod repeated_append; | ||
mod slice_copy; |
Oops, something went wrong.