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

Method try_from_object

crates/vm/src/convert/try_from.rs:20–22  ·  view source on GitHub ↗
(vm: &VirtualMachine, obj: PyObjectRef)

Source from the content-addressed store, hash-verified

18/// Rust-side only version of TryFromObject to reduce unnecessary Rc::clone
19impl<T: for<'a> TryFromBorrowedObject<'a>> TryFromObject for T {
20 fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> {
21 TryFromBorrowedObject::try_from_borrowed_object(vm, &obj)
22 }
23}
24
25impl PyObjectRef {

Callers

nothing calls this directly

Calls 14

newFunction · 0.85
fast_isinstanceMethod · 0.80
downcast_uncheckedMethod · 0.80
to_f64Method · 0.80
truncMethod · 0.80
try_index_optMethod · 0.80
as_bigintMethod · 0.80
ok_or_elseMethod · 0.80
ErrClass · 0.50
is_noneMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected