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

Method __iadd__

crates/stdlib/src/array.rs:1068–1084  ·  view source on GitHub ↗
(
            zelf: PyRef<Self>,
            other: PyObjectRef,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

1066 }
1067
1068 fn __iadd__(
1069 zelf: PyRef<Self>,
1070 other: PyObjectRef,
1071 vm: &VirtualMachine,
1072 ) -> PyResult<PyRef<Self>> {
1073 if zelf.is(&other) {
1074 zelf.try_resizable(vm)?.imul(2, vm)?;
1075 } else if let Some(other) = other.downcast_ref::<Self>() {
1076 zelf.try_resizable(vm)?.iadd(&other.read(), vm)?;
1077 } else {
1078 return Err(vm.new_type_error(format!(
1079 "can only extend array with array (not \"{}\")",
1080 other.class().name()
1081 )));
1082 }
1083 Ok(zelf)
1084 }
1085
1086 fn __mul__(&self, value: isize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
1087 self.read()

Callers

nothing calls this directly

Calls 6

isMethod · 0.80
try_resizableMethod · 0.80
iaddMethod · 0.80
ErrClass · 0.50
imulMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected