MCPcopy Index your code
hub / github.com/RustPython/RustPython / iconcat

Function iconcat

crates/vm/src/stdlib/_operator.rs:250–261  ·  view source on GitHub ↗
(a: PyObjectRef, b: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

248
249 #[pyfunction]
250 fn iconcat(a: PyObjectRef, b: PyObjectRef, vm: &VirtualMachine) -> PyResult {
251 // Best attempt at checking that a is sequence-like.
252 if !a.class().has_attr(identifier!(vm, __getitem__))
253 || a.fast_isinstance(vm.ctx.types.dict_type)
254 {
255 return Err(vm.new_type_error(format!(
256 "'{}' object can't be concatenated",
257 a.class().name()
258 )));
259 }
260 vm._iadd(&a, &b)
261 }
262
263 #[pyfunction]
264 fn ifloordiv(a: PyObjectRef, b: PyObjectRef, vm: &VirtualMachine) -> PyResult {

Callers

nothing calls this directly

Calls 5

fast_isinstanceMethod · 0.80
_iaddMethod · 0.80
ErrClass · 0.50
has_attrMethod · 0.45
classMethod · 0.45

Tested by

no test coverage detected