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

Method is_true

crates/vm/src/protocol/object.rs:47–49  ·  view source on GitHub ↗
(self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

45 // const hash_not_implemented: fn(&PyObject, &VirtualMachine) ->PyResult<PyHash> = crate::types::Unhashable::slot_hash;
46
47 pub fn is_true(self, vm: &VirtualMachine) -> PyResult<bool> {
48 self.try_to_bool(vm)
49 }
50
51 pub fn not(self, vm: &VirtualMachine) -> PyResult<bool> {
52 self.is_true(vm).map(|x| !x)

Callers 10

py_initMethod · 0.80
progress_callbackMethod · 0.80
check_matchedFunction · 0.80
already_warnedFunction · 0.80
notMethod · 0.80
from_paramMethod · 0.80
python_to_ffiFunction · 0.80
as_numberMethod · 0.80
initializeMethod · 0.80

Calls 1

try_to_boolMethod · 0.80

Tested by

no test coverage detected