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

Method removeprefix

crates/vm/src/bytes_inner.rs:633–639  ·  view source on GitHub ↗

new in Python 3.9

(&self, prefix: Self)

Source from the content-addressed store, hash-verified

631
632 // new in Python 3.9
633 pub fn removeprefix(&self, prefix: Self) -> Vec<u8> {
634 self.elements
635 .py_removeprefix(&prefix.elements, prefix.elements.len(), |s, p| {
636 s.starts_with(p)
637 })
638 .to_vec()
639 }
640
641 // new in Python 3.9
642 pub fn removesuffix(&self, suffix: Self) -> Vec<u8> {

Callers 10

test_removeprefixFunction · 0.45
test_removeprefix_typesFunction · 0.45
build_deoptsFunction · 0.45
dump_enumFunction · 0.45
dump_bitflagsFunction · 0.45
compute_test_todo_listFunction · 0.45
test_importsMethod · 0.45
resolve_hard_dep_parentFunction · 0.45
iter_patch_entriesMethod · 0.45
_path_abspathFunction · 0.45

Calls 4

to_vecMethod · 0.80
py_removeprefixMethod · 0.80
starts_withMethod · 0.80
lenMethod · 0.45

Tested by 3

test_removeprefixFunction · 0.36
test_removeprefix_typesFunction · 0.36
test_importsMethod · 0.36