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

Method try_sequence

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

Source from the content-addressed store, hash-verified

109 }
110
111 pub fn try_sequence(&self, vm: &VirtualMachine) -> PyResult<PySequence<'_>> {
112 let seq = self.sequence_unchecked();
113 if seq.check() {
114 Ok(seq)
115 } else {
116 Err(vm.new_type_error(format!("'{}' is not a sequence", self.class())))
117 }
118 }
119}
120
121#[derive(Copy, Clone)]

Callers 5

bind_parametersMethod · 0.80
get_itemMethod · 0.80
newMethod · 0.80
_mulMethod · 0.80
_imulMethod · 0.80

Calls 3

sequence_uncheckedMethod · 0.80
ErrClass · 0.50
checkMethod · 0.45

Tested by

no test coverage detected