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

Method __add__

crates/stdlib/src/array.rs:1055–1066  ·  view source on GitHub ↗
(&self, other: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1053 }
1054
1055 fn __add__(&self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
1056 if let Some(other) = other.downcast_ref::<Self>() {
1057 self.read()
1058 .add(&other.read(), vm)
1059 .map(|array| Self::from(array).into_ref(&vm.ctx))
1060 } else {
1061 Err(vm.new_type_error(format!(
1062 "can only append array (not \"{}\") to array",
1063 other.class().name()
1064 )))
1065 }
1066 }
1067
1068 fn __iadd__(
1069 zelf: PyRef<Self>,

Callers

nothing calls this directly

Calls 5

ErrClass · 0.50
mapMethod · 0.45
addMethod · 0.45
readMethod · 0.45
into_refMethod · 0.45

Tested by

no test coverage detected