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

Method slot_new

crates/vm/src/stdlib/typevar.rs:316–322  ·  view source on GitHub ↗
(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

314 type Args = FuncArgs;
315
316 fn slot_new(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult {
317 let typevar = <Self as Constructor>::py_new(&cls, args, vm)?;
318 let obj = typevar.into_ref_with_type(vm, cls)?;
319 let obj_ref: PyObjectRef = obj.into();
320 set_module_from_caller(&obj_ref, vm)?;
321 Ok(obj_ref)
322 }
323
324 fn py_new(_cls: &Py<PyType>, args: Self::Args, vm: &VirtualMachine) -> PyResult<Self> {
325 let mut kwargs = args.kwargs;

Callers

nothing calls this directly

Calls 15

set_module_from_callerFunction · 0.85
newFunction · 0.85
into_ref_with_typeMethod · 0.80
swap_removeMethod · 0.80
try_to_boolMethod · 0.80
collectMethod · 0.80
to_stringMethod · 0.80
noneMethod · 0.80
type_checkFunction · 0.70
ErrClass · 0.50
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected