MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / __iter__

Method __iter__

flow-message/src/cross/python/cow_list.rs:89–99  ·  view source on GitHub ↗
(this: PyRefMut<Self>)

Source from the content-addressed store, hash-verified

87#[pyproto]
88impl PyIterProtocol for PyCowList {
89 fn __iter__(this: PyRefMut<Self>) -> PyResult<super::iterator::PyObjectIterator> {
90 let gil = Python::acquire_gil();
91 let py = gil.python();
92
93 let mut elements = std::vec::Vec::new();
94 for element in this.as_ref().iter() {
95 elements.push(from_data(py, &element.clone())?);
96 }
97
98 Ok(super::iterator::PyObjectIterator::new(elements.into_iter()))
99 }
100}

Callers

nothing calls this directly

Calls 4

from_dataFunction · 0.85
as_refMethod · 0.80
pushMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected