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

Method py_new

crates/stdlib/src/pystruct.rs:245–249  ·  view source on GitHub ↗
(_cls: &Py<PyType>, fmt: Self::Args, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

243 type Args = IntoStructFormatBytes;
244
245 fn py_new(_cls: &Py<PyType>, fmt: Self::Args, vm: &VirtualMachine) -> PyResult<Self> {
246 let spec = fmt.format_spec(vm)?;
247 let format = fmt.0;
248 Ok(Self { spec, format })
249 }
250 }
251
252 #[pyclass(with(Constructor, Representable))]

Callers

nothing calls this directly

Calls 1

format_specMethod · 0.45

Tested by

no test coverage detected