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

Method call_with_args

crates/vm/src/protocol/callable.rs:27–35  ·  view source on GitHub ↗

PyObject_Call

(&self, args: FuncArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

25
26 /// PyObject_Call
27 pub fn call_with_args(&self, args: FuncArgs, vm: &VirtualMachine) -> PyResult {
28 let Some(callable) = self.to_callable() else {
29 return Err(
30 vm.new_type_error(format!("'{}' object is not callable", self.class().name()))
31 );
32 };
33 vm_trace!("Invoke: {:?} {:?}", callable, args);
34 callable.invoke(args, vm)
35 }
36
37 /// Vectorcall: call with owned positional args + optional kwnames.
38 /// Falls back to FuncArgs-based call if no vectorcall slot.

Callers 2

callMethod · 0.80
_excepthookFunction · 0.80

Calls 3

to_callableMethod · 0.80
ErrClass · 0.50
invokeMethod · 0.45

Tested by

no test coverage detected