diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index a064846d3fa..3530fc6c535 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -1226,8 +1226,6 @@ def test_map(self): c = map(tupleize, 'abc', count()) self.pickletest(proto, c) - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_starmap(self): self.assertEqual(list(starmap(operator.pow, zip(range(3), range(1,7)))), [0**1, 1**2, 2**3]) diff --git a/vm/src/stdlib/itertools.rs b/vm/src/stdlib/itertools.rs index 3366bc21ec6..63b37b6198a 100644 --- a/vm/src/stdlib/itertools.rs +++ b/vm/src/stdlib/itertools.rs @@ -404,7 +404,15 @@ mod decl { } #[pyimpl(with(IterNext, Constructor), flags(BASETYPE))] - impl PyItertoolsStarmap {} + impl PyItertoolsStarmap { + #[pymethod(magic)] + fn reduce(zelf: PyRef) -> (PyTypeRef, (PyObjectRef, PyIter)) { + ( + zelf.class().clone(), + (zelf.function.clone(), zelf.iterable.clone()), + ) + } + } impl IterNextIterable for PyItertoolsStarmap {} impl IterNext for PyItertoolsStarmap { fn next(zelf: &Py, vm: &VirtualMachine) -> PyResult {