---
source: crates/ruff/src/rules/ruff/mod.rs
---
RUF007.py:16:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
   |
16 | # Errors
17 | zip(input, input[1:])
   | ^^^ RUF007
18 | zip(input, input[1::1])
19 | zip(input[:-1], input[1:])
   |

RUF007.py:17:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
   |
17 | # Errors
18 | zip(input, input[1:])
19 | zip(input, input[1::1])
   | ^^^ RUF007
20 | zip(input[:-1], input[1:])
21 | zip(input[1:], input[2:])
   |

RUF007.py:18:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
   |
18 | zip(input, input[1:])
19 | zip(input, input[1::1])
20 | zip(input[:-1], input[1:])
   | ^^^ RUF007
21 | zip(input[1:], input[2:])
22 | zip(input[1:-1], input[2:])
   |

RUF007.py:19:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
   |
19 | zip(input, input[1::1])
20 | zip(input[:-1], input[1:])
21 | zip(input[1:], input[2:])
   | ^^^ RUF007
22 | zip(input[1:-1], input[2:])
23 | list(zip(input, input[1:]))
   |

RUF007.py:20:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
   |
20 | zip(input[:-1], input[1:])
21 | zip(input[1:], input[2:])
22 | zip(input[1:-1], input[2:])
   | ^^^ RUF007
23 | list(zip(input, input[1:]))
24 | list(zip(input[:-1], input[1:]))
   |

RUF007.py:21:6: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
   |
21 | zip(input[1:], input[2:])
22 | zip(input[1:-1], input[2:])
23 | list(zip(input, input[1:]))
   |      ^^^ RUF007
24 | list(zip(input[:-1], input[1:]))
25 | zip(foo[:-1], foo[1:], strict=True)
   |

RUF007.py:22:6: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
   |
22 | zip(input[1:-1], input[2:])
23 | list(zip(input, input[1:]))
24 | list(zip(input[:-1], input[1:]))
   |      ^^^ RUF007
25 | zip(foo[:-1], foo[1:], strict=True)
26 | zip(foo[:-1], foo[1:], strict=False)
   |

RUF007.py:23:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
   |
23 | list(zip(input, input[1:]))
24 | list(zip(input[:-1], input[1:]))
25 | zip(foo[:-1], foo[1:], strict=True)
   | ^^^ RUF007
26 | zip(foo[:-1], foo[1:], strict=False)
27 | zip(foo[:-1], foo[1:], strict=bool(foo))
   |

RUF007.py:24:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
   |
24 | list(zip(input[:-1], input[1:]))
25 | zip(foo[:-1], foo[1:], strict=True)
26 | zip(foo[:-1], foo[1:], strict=False)
   | ^^^ RUF007
27 | zip(foo[:-1], foo[1:], strict=bool(foo))
   |

RUF007.py:25:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
   |
25 | zip(foo[:-1], foo[1:], strict=True)
26 | zip(foo[:-1], foo[1:], strict=False)
27 | zip(foo[:-1], foo[1:], strict=bool(foo))
   | ^^^ RUF007
   |


