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

Function str_wrapper

crates/vm/src/types/slot.rs:476–484  ·  view source on GitHub ↗
(zelf: &PyObject, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

474}
475
476fn str_wrapper(zelf: &PyObject, vm: &VirtualMachine) -> PyResult<PyRef<PyStr>> {
477 let ret = vm.call_special_method(zelf, identifier!(vm, __str__), ())?;
478 ret.downcast::<PyStr>().map_err(|obj| {
479 vm.new_type_error(format!(
480 "__str__ returned non-string (type {})",
481 obj.class()
482 ))
483 })
484}
485
486fn hash_wrapper(zelf: &PyObject, vm: &VirtualMachine) -> PyResult<PyHash> {
487 let hash_obj = vm.call_special_method(zelf, identifier!(vm, __hash__), ())?;

Callers

nothing calls this directly

Calls 1

call_special_methodMethod · 0.80

Tested by

no test coverage detected