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

Method slot_new

crates/vm/src/exceptions.rs:740–747  ·  view source on GitHub ↗
(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

738 type Args = FuncArgs;
739
740 fn slot_new(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult {
741 if cls.is(Self::class(&vm.ctx)) && !args.kwargs.is_empty() {
742 return Err(vm.new_type_error("BaseException() takes no keyword arguments"));
743 }
744 Self::new(args.args, vm)
745 .into_ref_with_type(vm, cls)
746 .map(Into::into)
747 }
748
749 fn py_new(_cls: &Py<PyType>, _args: FuncArgs, _vm: &VirtualMachine) -> PyResult<Self> {
750 unimplemented!("use slot_new")

Callers

nothing calls this directly

Calls 15

newFunction · 0.85
errno_to_exc_typeFunction · 0.85
isMethod · 0.80
into_ref_with_typeMethod · 0.80
to_vecMethod · 0.80
okMethod · 0.80
invoke_exceptionMethod · 0.80
ErrClass · 0.50
is_emptyMethod · 0.45
mapMethod · 0.45
nameMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected