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

Method length_opt

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

Source from the content-addressed store, hash-verified

692 }
693
694 pub fn length_opt(&self, vm: &VirtualMachine) -> Option<PyResult<usize>> {
695 self.sequence_unchecked()
696 .length_opt(vm)
697 .or_else(|| self.mapping_unchecked().length_opt(vm))
698 }
699
700 pub fn length(&self, vm: &VirtualMachine) -> PyResult<usize> {
701 self.length_opt(vm).ok_or_else(|| {

Callers 3

lengthMethod · 0.45
slot_newMethod · 0.45
extract_clonedFunction · 0.45

Calls 2

sequence_uncheckedMethod · 0.80
mapping_uncheckedMethod · 0.80

Tested by

no test coverage detected