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

Method extend

crates/vm/src/builtins/bytearray.rs:614–622  ·  view source on GitHub ↗
(&self, object: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

612
613 #[pymethod]
614 fn extend(&self, object: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
615 if self.is(&object) {
616 PyByteArray::irepeat(self, 2, vm)
617 } else {
618 let items = bytes_from_object(vm, &object)?;
619 self.try_resizable(vm)?.elements.extend(items);
620 Ok(())
621 }
622 }
623
624 #[pymethod]
625 fn clear(&self, vm: &VirtualMachine) -> PyResult<()> {

Callers 1

__iadd__Method · 0.45

Calls 3

bytes_from_objectFunction · 0.85
isMethod · 0.80
try_resizableMethod · 0.80

Tested by

no test coverage detected