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

Method call_method

crates/vm/src/vm/vm_object.rs:131–146  ·  view source on GitHub ↗
(&self, obj: &PyObject, method_name: &str, args: T)

Source from the content-addressed store, hash-verified

129
130 #[inline]
131 pub fn call_method<T>(&self, obj: &PyObject, method_name: &str, args: T) -> PyResult
132 where
133 T: IntoFuncArgs,
134 {
135 flame_guard!(format!("call_method({:?})", method_name));
136
137 let dynamic_name;
138 let name = match self.ctx.interned_str(method_name) {
139 Some(name) => name.as_pystr(&self.ctx),
140 None => {
141 dynamic_name = self.ctx.new_str(method_name);
142 &dynamic_name
143 }
144 };
145 PyMethod::get(obj.to_owned(), name, self)?.invoke(args, self)
146 }
147
148 pub fn dir(&self, obj: Option<PyObjectRef>) -> PyResult<PyList> {
149 let seq = match obj {

Callers 15

get_fd_from_file_optFunction · 0.45
add_done_callbackMethod · 0.45
awaited_by_addMethod · 0.45
awaited_by_discardMethod · 0.45
delMethod · 0.45
sendMethod · 0.45
py_initMethod · 0.45
cancelMethod · 0.45
task_eager_startFunction · 0.45
task_step_implFunction · 0.45
task_step_handle_resultFunction · 0.45

Calls 6

getFunction · 0.85
interned_strMethod · 0.80
as_pystrMethod · 0.80
new_strMethod · 0.45
invokeMethod · 0.45
to_ownedMethod · 0.45

Tested by 1

write_inputFunction · 0.36