| 48 | impl PyZip { |
| 49 | #[pymethod] |
| 50 | fn __reduce__(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult<PyTupleRef> { |
| 51 | let cls = zelf.class().to_owned(); |
| 52 | let iterators = zelf |
| 53 | .iterators |
| 54 | .iter() |
| 55 | .map(|obj| obj.clone().into()) |
| 56 | .collect::<Vec<_>>(); |
| 57 | let tuple_iter = vm.ctx.new_tuple(iterators); |
| 58 | Ok(if zelf.strict.load(atomic::Ordering::Acquire) { |
| 59 | vm.new_tuple((cls, tuple_iter, true)) |
| 60 | } else { |
| 61 | vm.new_tuple((cls, tuple_iter)) |
| 62 | }) |
| 63 | } |
| 64 | |
| 65 | #[pymethod] |
| 66 | fn __setstate__(zelf: PyRef<Self>, state: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> { |