(&self, other: Py<PyCowList>)
| 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(); |