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

Method rpartition

crates/vm/src/builtins/bytearray.rs:483–492  ·  view source on GitHub ↗
(&self, sep: PyBytesInner, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

481
482 #[pymethod]
483 fn rpartition(&self, sep: PyBytesInner, vm: &VirtualMachine) -> PyResult<PyTupleRef> {
484 let value = self.inner();
485 let (back, has_mid, front) = value.rpartition(&sep, vm)?;
486 Ok(vm.new_tuple((
487 vm.ctx.new_bytearray(front.to_vec()),
488 vm.ctx
489 .new_bytearray(if has_mid { sep.elements } else { Vec::new() }),
490 vm.ctx.new_bytearray(back.to_vec()),
491 )))
492 }
493
494 #[pymethod]
495 fn expandtabs(&self, options: anystr::ExpandTabsArgs) -> Self {

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
new_bytearrayMethod · 0.80
to_vecMethod · 0.80
innerMethod · 0.45
new_tupleMethod · 0.45

Tested by

no test coverage detected