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

Method slot_new

crates/vm/src/builtins/singletons.rs:43–46  ·  view source on GitHub ↗
(_cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

41 type Args = ();
42
43 fn slot_new(_cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult {
44 let _: () = args.bind(vm)?;
45 Ok(vm.ctx.none.clone().into())
46 }
47
48 fn py_new(_cls: &Py<PyType>, _args: Self::Args, _vm: &VirtualMachine) -> PyResult<Self> {
49 unreachable!("None is a singleton")

Callers

nothing calls this directly

Calls 2

bindMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected