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

Method try_float

crates/vm/src/protocol/number.rs:104–108  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

102
103 #[inline]
104 pub fn try_float(&self, vm: &VirtualMachine) -> PyResult<PyRef<PyFloat>> {
105 self.try_float_opt(vm).ok_or_else(|| {
106 vm.new_type_error(format!("must be real number, not {}", self.class()))
107 })?
108 }
109}
110
111#[derive(Default)]

Callers 15

acquireMethod · 0.80
logFunction · 0.80
log2Function · 0.80
log10Function · 0.80
shutdownMethod · 0.80
try_from_objectMethod · 0.80
set_primitiveFunction · 0.80
from_paramMethod · 0.80
value_to_bytes_endianFunction · 0.80
conv_paramFunction · 0.80

Calls 2

ok_or_elseMethod · 0.80
try_float_optMethod · 0.80

Tested by

no test coverage detected