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

Method __concat__

flow-message/src/cross/python/cow_list.rs:49–66  ·  view source on GitHub ↗
(&self, other: Py<PyCowList>)

Source from the content-addressed store, hash-verified

47 }
48
49 fn __concat__(&self, other: Py<PyCowList>) -> PyResult<PyObject> {
50 let gil = Python::acquire_gil();
51 let py = gil.python();
52 let other = other.borrow(py);
53 let newlist = self
54 .as_ref()
55 .iter()
56 .chain(other.as_ref().iter())
57 .cloned()
58 .collect::<CowList>();
59 Py::new(
60 py,
61 PyCowList {
62 inner: Some(newlist),
63 },
64 )
65 .map(|list| list.to_object(py))
66 }
67
68 fn __repeat__(&self, count: isize) -> PyResult<PyObject> {
69 let gil = Python::acquire_gil();

Callers

nothing calls this directly

Calls 3

chainMethod · 0.80
as_refMethod · 0.80
to_objectMethod · 0.80

Tested by

no test coverage detected