---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
---
B905.py:4:1: B905 [*] `zip()` without an explicit `strict=` parameter
  |
3 | # Errors
4 | zip()
  | ^^^^^ B905
5 | zip(range(3))
6 | zip("a", "b")
  |
  = help: Add explicit `strict=False`

ℹ Safe fix
1 1 | from itertools import count, cycle, repeat
2 2 | 
3 3 | # Errors
4   |-zip()
  4 |+zip(strict=False)
5 5 | zip(range(3))
6 6 | zip("a", "b")
7 7 | zip("a", "b", *zip("c"))

B905.py:5:1: B905 [*] `zip()` without an explicit `strict=` parameter
  |
3 | # Errors
4 | zip()
5 | zip(range(3))
  | ^^^^^^^^^^^^^ B905
6 | zip("a", "b")
7 | zip("a", "b", *zip("c"))
  |
  = help: Add explicit `strict=False`

ℹ Safe fix
2 2 | 
3 3 | # Errors
4 4 | zip()
5   |-zip(range(3))
  5 |+zip(range(3), strict=False)
6 6 | zip("a", "b")
7 7 | zip("a", "b", *zip("c"))
8 8 | zip(zip("a"), strict=False)

B905.py:6:1: B905 [*] `zip()` without an explicit `strict=` parameter
  |
4 | zip()
5 | zip(range(3))
6 | zip("a", "b")
  | ^^^^^^^^^^^^^ B905
7 | zip("a", "b", *zip("c"))
8 | zip(zip("a"), strict=False)
  |
  = help: Add explicit `strict=False`

ℹ Safe fix
3 3 | # Errors
4 4 | zip()
5 5 | zip(range(3))
6   |-zip("a", "b")
  6 |+zip("a", "b", strict=False)
7 7 | zip("a", "b", *zip("c"))
8 8 | zip(zip("a"), strict=False)
9 9 | zip(zip("a", strict=True))

B905.py:7:1: B905 [*] `zip()` without an explicit `strict=` parameter
  |
5 | zip(range(3))
6 | zip("a", "b")
7 | zip("a", "b", *zip("c"))
  | ^^^^^^^^^^^^^^^^^^^^^^^^ B905
8 | zip(zip("a"), strict=False)
9 | zip(zip("a", strict=True))
  |
  = help: Add explicit `strict=False`

ℹ Safe fix
4 4 | zip()
5 5 | zip(range(3))
6 6 | zip("a", "b")
7   |-zip("a", "b", *zip("c"))
  7 |+zip("a", "b", *zip("c"), strict=False)
8 8 | zip(zip("a"), strict=False)
9 9 | zip(zip("a", strict=True))
10 10 | 

B905.py:7:16: B905 [*] `zip()` without an explicit `strict=` parameter
  |
5 | zip(range(3))
6 | zip("a", "b")
7 | zip("a", "b", *zip("c"))
  |                ^^^^^^^^ B905
8 | zip(zip("a"), strict=False)
9 | zip(zip("a", strict=True))
  |
  = help: Add explicit `strict=False`

ℹ Safe fix
4 4 | zip()
5 5 | zip(range(3))
6 6 | zip("a", "b")
7   |-zip("a", "b", *zip("c"))
  7 |+zip("a", "b", *zip("c", strict=False))
8 8 | zip(zip("a"), strict=False)
9 9 | zip(zip("a", strict=True))
10 10 | 

B905.py:8:5: B905 [*] `zip()` without an explicit `strict=` parameter
  |
6 | zip("a", "b")
7 | zip("a", "b", *zip("c"))
8 | zip(zip("a"), strict=False)
  |     ^^^^^^^^ B905
9 | zip(zip("a", strict=True))
  |
  = help: Add explicit `strict=False`

ℹ Safe fix
5 5 | zip(range(3))
6 6 | zip("a", "b")
7 7 | zip("a", "b", *zip("c"))
8   |-zip(zip("a"), strict=False)
  8 |+zip(zip("a", strict=False), strict=False)
9 9 | zip(zip("a", strict=True))
10 10 | 
11 11 | # OK

B905.py:9:1: B905 [*] `zip()` without an explicit `strict=` parameter
   |
 7 | zip("a", "b", *zip("c"))
 8 | zip(zip("a"), strict=False)
 9 | zip(zip("a", strict=True))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ B905
10 | 
11 | # OK
   |
   = help: Add explicit `strict=False`

ℹ Safe fix
6  6  | zip("a", "b")
7  7  | zip("a", "b", *zip("c"))
8  8  | zip(zip("a"), strict=False)
9     |-zip(zip("a", strict=True))
   9  |+zip(zip("a", strict=True), strict=False)
10 10 | 
11 11 | # OK
12 12 | zip(range(3), strict=True)

B905.py:24:1: B905 [*] `zip()` without an explicit `strict=` parameter
   |
23 | # Errors (limited iterators).
24 | zip([1, 2, 3], repeat(1, 1))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B905
25 | zip([1, 2, 3], repeat(1, times=4))
   |
   = help: Add explicit `strict=False`

ℹ Safe fix
21 21 | zip([1, 2, 3], repeat(1, times=None))
22 22 | 
23 23 | # Errors (limited iterators).
24    |-zip([1, 2, 3], repeat(1, 1))
   24 |+zip([1, 2, 3], repeat(1, 1), strict=False)
25 25 | zip([1, 2, 3], repeat(1, times=4))
26 26 | 
27 27 | import builtins

B905.py:25:1: B905 [*] `zip()` without an explicit `strict=` parameter
   |
23 | # Errors (limited iterators).
24 | zip([1, 2, 3], repeat(1, 1))
25 | zip([1, 2, 3], repeat(1, times=4))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B905
26 | 
27 | import builtins
   |
   = help: Add explicit `strict=False`

ℹ Safe fix
22 22 | 
23 23 | # Errors (limited iterators).
24 24 | zip([1, 2, 3], repeat(1, 1))
25    |-zip([1, 2, 3], repeat(1, times=4))
   25 |+zip([1, 2, 3], repeat(1, times=4), strict=False)
26 26 | 
27 27 | import builtins
28 28 | # Still an error even though it uses the qualified name

B905.py:29:1: B905 [*] `zip()` without an explicit `strict=` parameter
   |
27 | import builtins
28 | # Still an error even though it uses the qualified name
29 | builtins.zip([1, 2, 3])
   | ^^^^^^^^^^^^^^^^^^^^^^^ B905
   |
   = help: Add explicit `strict=False`

ℹ Safe fix
26 26 | 
27 27 | import builtins
28 28 | # Still an error even though it uses the qualified name
29    |-builtins.zip([1, 2, 3])
   29 |+builtins.zip([1, 2, 3], strict=False)
