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

Function format

crates/vm/src/stdlib/builtins.rs:612–618  ·  view source on GitHub ↗
(
        value: PyObjectRef,
        format_spec: OptionalArg<PyStrRef>,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

610
611 #[pyfunction]
612 fn format(
613 value: PyObjectRef,
614 format_spec: OptionalArg<PyStrRef>,
615 vm: &VirtualMachine,
616 ) -> PyResult<PyStrRef> {
617 vm.format(&value, format_spec.unwrap_or(vm.ctx.new_str("")))
618 }
619
620 #[pyfunction]
621 fn getattr(

Callers 1

formatMethod · 0.50

Calls 2

formatMethod · 0.45
new_strMethod · 0.45

Tested by

no test coverage detected