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
Prev Previous commit
Next Next commit
Feat: impl PyArrayIter.setstate
  • Loading branch information
Yaminyam committed Jul 16, 2022
commit 2417d3e81363aeae37c8a51bd8594fef59c63b61
7 changes: 7 additions & 0 deletions stdlib/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,13 @@ mod array {

#[pyimpl(with(IterNext), flags(HAS_DICT))]
impl PyArrayIter {
#[pymethod(magic)]
fn setstate(&self, state: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
self.internal
.lock()
.set_state(state, |obj, pos| pos.min(obj.len()), vm)
}

#[pymethod(magic)]
fn reduce(&self, vm: &VirtualMachine) -> PyTupleRef {
self.internal
Expand Down