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

Method to_dict

flow-rs/src/loader/python/port.rs:56–65  ·  view source on GitHub ↗
(&self, py: Python)

Source from the content-addressed store, hash-verified

54 }
55
56 fn to_dict(&self, py: Python) -> PyResult<PyObject> {
57 use pyo3::types::IntoPyDict;
58 let mut list = vec![];
59 for (k, v) in self.storage.iter() {
60 let v = v.clone().into_object(py)?;
61 let k = k.to_object(py);
62 list.push((k, v));
63 }
64 Ok(list.into_py_dict(py).to_object(py))
65 }
66}
67
68impl<T> ToPyObject for AnyPort<T>

Callers 1

to_objectMethod · 0.80

Calls 5

into_objectMethod · 0.80
to_objectMethod · 0.80
pushMethod · 0.80
into_py_dictMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected