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

Function type_check

crates/vm/src/stdlib/typevar.rs:17–24  ·  view source on GitHub ↗
(arg: PyObjectRef, msg: &str, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

15 };
16
17 fn type_check(arg: PyObjectRef, msg: &str, vm: &VirtualMachine) -> PyResult<PyObjectRef> {
18 // Calling typing.py here leads to bootstrapping problems
19 if vm.is_none(&arg) {
20 return Ok(arg.class().to_owned().into());
21 }
22 let message_str: PyObjectRef = vm.ctx.new_str(msg).into();
23 call_typing_func_object(vm, "_type_check", (arg, message_str))
24 }
25
26 fn variance_repr(
27 name: &str,

Callers 2

py_newMethod · 0.70
slot_newMethod · 0.70

Calls 5

call_typing_func_objectFunction · 0.85
is_noneMethod · 0.45
to_ownedMethod · 0.45
classMethod · 0.45
new_strMethod · 0.45

Tested by

no test coverage detected