(a: PyObjectRef, b: PyObjectRef, vm: &VirtualMachine)
| 159 | |
| 160 | #[pyfunction] |
| 161 | fn concat(a: PyObjectRef, b: PyObjectRef, vm: &VirtualMachine) -> PyResult { |
| 162 | // Best attempt at checking that a is sequence-like. |
| 163 | if !a.class().has_attr(identifier!(vm, __getitem__)) |
| 164 | || a.fast_isinstance(vm.ctx.types.dict_type) |
| 165 | { |
| 166 | return Err( |
| 167 | vm.new_type_error(format!("{} object can't be concatenated", a.class().name())) |
| 168 | ); |
| 169 | } |
| 170 | vm._add(&a, &b) |
| 171 | } |
| 172 | |
| 173 | #[pyfunction] |
| 174 | fn contains(a: PyObjectRef, b: PyObjectRef, vm: &VirtualMachine) -> PyResult<bool> { |
nothing calls this directly
no test coverage detected