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

Method get_item

crates/vm/src/protocol/sequence.rs:230–238  ·  view source on GitHub ↗
(self, i: isize, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

228 }
229
230 pub fn get_item(self, i: isize, vm: &VirtualMachine) -> PyResult {
231 if let Some(f) = self.slots().item.load() {
232 return f(self, i, vm);
233 }
234 Err(vm.new_type_error(format!(
235 "'{}' is not a sequence or does not support indexing",
236 self.obj.class()
237 )))
238 }
239
240 fn _ass_item(self, i: isize, value: Option<PyObjectRef>, vm: &VirtualMachine) -> PyResult<()> {
241 if let Some(f) = self.slots().ass_item.load() {

Callers

nothing calls this directly

Calls 4

fFunction · 0.50
ErrClass · 0.50
loadMethod · 0.45
slotsMethod · 0.45

Tested by

no test coverage detected