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

Method __setitem__

flow-message/src/cross/python/map.rs:19–25  ·  view source on GitHub ↗
(&mut self, attr: String, value: PyObject)

Source from the content-addressed store, hash-verified

17 self.as_ref().len()
18 }
19 fn __setitem__(&mut self, attr: String, value: PyObject) -> PyResult<()> {
20 let gil = Python::acquire_gil();
21 let py = gil.python();
22 let data = to_data(py, value)?;
23 self.as_mut().insert(attr, data);
24 Ok(())
25 }
26
27 fn __getitem__(&self, attr: &str) -> PyResult<PyObject> {
28 let gil = Python::acquire_gil();

Callers

nothing calls this directly

Calls 2

to_dataFunction · 0.85
insertMethod · 0.80

Tested by

no test coverage detected