Feat: impl `PyArrayIter.setstate`
@@ -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
