Skip to content

Commit dbdbdc8

Browse files
committed
feat: itertools.compress.__reduce__
1 parent 81d2df8 commit dbdbdc8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

vm/src/stdlib/itertools.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ mod decl {
142142
}
143143

144144
#[pyimpl(with(IterNext, Constructor))]
145-
impl PyItertoolsCompress {}
145+
impl PyItertoolsCompress {
146+
#[pymethod(magic)]
147+
fn reduce(zelf: PyRef<Self>) -> (PyTypeRef, (PyIter, PyIter)) {
148+
(zelf.class().clone(), (zelf.data.clone(), zelf.selectors.clone()))
149+
}
150+
}
146151

147152
impl IterNextIterable for PyItertoolsCompress {}
148153
impl IterNext for PyItertoolsCompress {

0 commit comments

Comments
 (0)