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

Method split

crates/vm/src/bytes_inner.rs:650–668  ·  view source on GitHub ↗
(
        &self,
        options: ByteInnerSplitOptions,
        convert: F,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

648 }
649
650 pub fn split<F>(
651 &self,
652 options: ByteInnerSplitOptions,
653 convert: F,
654 vm: &VirtualMachine,
655 ) -> PyResult<Vec<PyObjectRef>>
656 where
657 F: Fn(&[u8], &VirtualMachine) -> PyObjectRef,
658 {
659 let elements = self.elements.py_split(
660 options,
661 vm,
662 || convert(&self.elements, vm),
663 |v, s, vm| v.split_str(s).map(|v| convert(v, vm)).collect(),
664 |v, s, n, vm| v.splitn_str(n, s).map(|v| convert(v, vm)).collect(),
665 |v, n, vm| v.py_split_whitespace(n, |v| convert(v, vm)),
666 )?;
667 Ok(elements)
668 }
669
670 pub fn rsplit<F>(
671 &self,

Callers

nothing calls this directly

Calls 5

py_splitMethod · 0.80
collectMethod · 0.80
convertFunction · 0.50
mapMethod · 0.45
py_split_whitespaceMethod · 0.45

Tested by

no test coverage detected