Skip to content
Merged
Changes from 3 commits
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
12 changes: 11 additions & 1 deletion vm/src/stdlib/itertools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,16 @@ mod decl {
}

#[pyimpl(with(IterNext, Constructor))]
impl PyItertoolsCount {}
impl PyItertoolsCount {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

// TODO: Implement this
// if (lz->cnt == PY_SSIZE_T_MAX)
// return Py_BuildValue("0(00)", Py_TYPE(lz), lz->long_cnt, lz->long_step);
#[pymethod(magic)]
fn reduce(zelf: PyRef<Self>) -> (PyTypeRef, (BigInt,)) {
(zelf.class().clone(), (zelf.cur.read().clone(),))
}
}
impl IterNextIterable for PyItertoolsCount {}
impl IterNext for PyItertoolsCount {
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
Expand Down Expand Up @@ -303,6 +312,7 @@ mod decl {
Ok(*times.read())
}


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

#[pymethod(magic)]
fn reduce(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult<PyTupleRef> {
let cls = zelf.class().clone();
Expand Down