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

Method slot_call

crates/vm/src/types/slot.rs:1697–1711  ·  view source on GitHub ↗
(zelf: &PyObject, args: FuncArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1695 #[inline]
1696 #[pyslot]
1697 fn slot_call(zelf: &PyObject, args: FuncArgs, vm: &VirtualMachine) -> PyResult {
1698 let zelf = zelf.downcast_ref().ok_or_else(|| {
1699 let repr = zelf.repr(vm);
1700 let help: Wtf8Buf = if let Ok(repr) = repr.as_ref() {
1701 repr.as_wtf8().to_owned()
1702 } else {
1703 zelf.class().name().to_owned().into()
1704 };
1705 let mut msg = Wtf8Buf::from("unexpected payload for __call__ of ");
1706 msg.push_wtf8(&help);
1707 vm.new_type_error(msg)
1708 })?;
1709 let args = args.bind(vm)?;
1710 Self::call(zelf, args, vm)
1711 }
1712
1713 fn call(zelf: &Py<Self>, args: Self::Args, vm: &VirtualMachine) -> PyResult;
1714}

Callers

nothing calls this directly

Implementers 14

_asyncio.rscrates/stdlib/src/_asyncio.rs
json.rscrates/stdlib/src/json.rs
_sqlite3.rscrates/stdlib/src/_sqlite3.rs
_operator.rscrates/vm/src/stdlib/_operator.rs
_functools.rscrates/vm/src/stdlib/_functools.rs
_typing.rscrates/vm/src/stdlib/_typing.rs
function.rscrates/vm/src/stdlib/_ctypes/function.
staticmethod.rscrates/vm/src/builtins/staticmethod.rs
genericalias.rscrates/vm/src/builtins/genericalias.rs
builtin_func.rscrates/vm/src/builtins/builtin_func.rs
weakref.rscrates/vm/src/builtins/weakref.rs
function.rscrates/vm/src/builtins/function.rs

Calls 11

ok_or_elseMethod · 0.80
downcast_refMethod · 0.80
push_wtf8Method · 0.80
callFunction · 0.50
reprMethod · 0.45
as_refMethod · 0.45
to_ownedMethod · 0.45
as_wtf8Method · 0.45
nameMethod · 0.45
classMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected