Skip to content

Commit 6f0c306

Browse files
committed
Add itertools.starmap.__reduce__
1 parent ac48968 commit 6f0c306

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

vm/src/stdlib/itertools.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,15 @@ mod decl {
404404
}
405405

406406
#[pyimpl(with(IterNext, Constructor), flags(BASETYPE))]
407-
impl PyItertoolsStarmap {}
407+
impl PyItertoolsStarmap {
408+
#[pymethod(magic)]
409+
fn reduce(zelf: PyRef<Self>) -> (PyTypeRef, (PyObjectRef, PyIter)) {
410+
(
411+
zelf.class().clone(),
412+
(zelf.function.clone(), zelf.iterable.clone()),
413+
)
414+
}
415+
}
408416
impl IterNextIterable for PyItertoolsStarmap {}
409417
impl IterNext for PyItertoolsStarmap {
410418
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {

0 commit comments

Comments
 (0)