Skip to content

Commit fa7e621

Browse files
Apply ruff/refurb preview rule FURB140
FURB140 Use `itertools.starmap` instead of the generator
1 parent 71cc0c2 commit fa7e621

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_properties.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
pytest.importorskip("hypothesis")
1212

13+
from itertools import starmap
14+
1315
import hypothesis.extra.numpy as npst
1416
import hypothesis.strategies as st
1517
from hypothesis import assume, given, settings
@@ -60,7 +62,7 @@ def deep_equal(a: Any, b: Any) -> bool:
6062
if isinstance(a, np.ndarray) and isinstance(b, np.ndarray):
6163
if a.shape != b.shape:
6264
return False
63-
return all(deep_equal(x, y) for x, y in zip(a.flat, b.flat, strict=False))
65+
return all(starmap(deep_equal, zip(a.flat, b.flat, strict=False)))
6466

6567
if isinstance(a, dict) and isinstance(b, dict):
6668
if set(a.keys()) != set(b.keys()):
@@ -70,7 +72,7 @@ def deep_equal(a: Any, b: Any) -> bool:
7072
if isinstance(a, (list, tuple)) and isinstance(b, (list, tuple)):
7173
if len(a) != len(b):
7274
return False
73-
return all(deep_equal(x, y) for x, y in zip(a, b, strict=False))
75+
return all(starmap(deep_equal, zip(a, b, strict=False)))
7476

7577
return a == b
7678

0 commit comments

Comments
 (0)