(&self, other: &PyObject, vm: &VirtualMachine)
| 199 | } |
| 200 | |
| 201 | fn concat(&self, other: &PyObject, vm: &VirtualMachine) -> PyResult<PyRef<Self>> { |
| 202 | let other = other.downcast_ref::<Self>().ok_or_else(|| { |
| 203 | vm.new_type_error(format!( |
| 204 | "Cannot add {} and {}", |
| 205 | Self::class(&vm.ctx).name(), |
| 206 | other.class().name() |
| 207 | )) |
| 208 | })?; |
| 209 | let mut elements = self.borrow_vec().to_vec(); |
| 210 | elements.extend(other.borrow_vec().iter().cloned()); |
| 211 | Ok(Self::from(elements).into_ref(&vm.ctx)) |
| 212 | } |
| 213 | |
| 214 | fn __add__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyRef<Self>> { |
| 215 | self.concat(&other, vm) |
no test coverage detected