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

Method length

crates/vm/src/protocol/sequence.rs:146–153  ·  view source on GitHub ↗
(self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

144 }
145
146 pub fn length(self, vm: &VirtualMachine) -> PyResult<usize> {
147 self.length_opt(vm).ok_or_else(|| {
148 vm.new_type_error(format!(
149 "'{}' is not a sequence or has no len()",
150 self.obj.class()
151 ))
152 })?
153 }
154
155 pub fn concat(self, other: &PyObject, vm: &VirtualMachine) -> PyResult {
156 if let Some(f) = self.slots().concat.load() {

Callers 1

extractMethod · 0.45

Calls 2

ok_or_elseMethod · 0.80
length_optMethod · 0.45

Tested by

no test coverage detected