Skip to content

Commit 2417d3e

Browse files
committed
Feat: impl PyArrayIter.setstate
1 parent 50aebef commit 2417d3e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

stdlib/src/array.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,13 @@ mod array {
12831283

12841284
#[pyimpl(with(IterNext), flags(HAS_DICT))]
12851285
impl PyArrayIter {
1286+
#[pymethod(magic)]
1287+
fn setstate(&self, state: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
1288+
self.internal
1289+
.lock()
1290+
.set_state(state, |obj, pos| pos.min(obj.len()), vm)
1291+
}
1292+
12861293
#[pymethod(magic)]
12871294
fn reduce(&self, vm: &VirtualMachine) -> PyTupleRef {
12881295
self.internal

0 commit comments

Comments
 (0)