Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add itertools.starmap.__reduce__
  • Loading branch information
jeffwang0516 committed Aug 1, 2022
commit 6f0c30605fbe9421dc9594e53063c71e9a32d35a
10 changes: 9 additions & 1 deletion vm/src/stdlib/itertools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,15 @@ mod decl {
}

#[pyimpl(with(IterNext, Constructor), flags(BASETYPE))]
impl PyItertoolsStarmap {}
impl PyItertoolsStarmap {
#[pymethod(magic)]
fn reduce(zelf: PyRef<Self>) -> (PyTypeRef, (PyObjectRef, PyIter)) {
(
zelf.class().clone(),
(zelf.function.clone(), zelf.iterable.clone()),
)
}
}
impl IterNextIterable for PyItertoolsStarmap {}
impl IterNext for PyItertoolsStarmap {
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
Expand Down