diff --git a/vm/src/stdlib/itertools.rs b/vm/src/stdlib/itertools.rs index 91dbd7489db..526ab61af3d 100644 --- a/vm/src/stdlib/itertools.rs +++ b/vm/src/stdlib/itertools.rs @@ -1670,7 +1670,15 @@ mod decl { } #[pyclass(with(IterNext, Iterable, Constructor))] - impl PyItertoolsPermutations {} + impl PyItertoolsPermutations { + #[pymethod(magic)] + fn reduce(zelf: PyRef, vm: &VirtualMachine) -> PyRef { + vm.new_tuple(( + zelf.class().to_owned(), + vm.new_tuple((zelf.pool.clone(), vm.ctx.new_int(zelf.r.load()))), + )) + } + } impl SelfIter for PyItertoolsPermutations {} impl IterNext for PyItertoolsPermutations { fn next(zelf: &Py, vm: &VirtualMachine) -> PyResult {