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

Method getitem_by_slice

crates/vm/src/builtins/memory.rs:157–163  ·  view source on GitHub ↗
(&self, slice: &PySlice, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

155 }
156
157 fn getitem_by_slice(&self, slice: &PySlice, vm: &VirtualMachine) -> PyResult {
158 let mut other = self.new_view();
159 other.init_slice(slice, 0, vm)?;
160 other.init_len();
161
162 Ok(other.into_ref(&vm.ctx).into())
163 }
164
165 fn getitem_by_multi_idx(&self, indexes: &[isize], vm: &VirtualMachine) -> PyResult {
166 let pos = self.pos_from_multi_index(indexes, vm)?;

Callers 7

__getitem__Method · 0.45
_getitemMethod · 0.45
_getitemMethod · 0.45
__getitem__Method · 0.45
_getitemMethod · 0.45
_getitemMethod · 0.45
_getitemMethod · 0.45

Calls 4

new_viewMethod · 0.80
init_sliceMethod · 0.80
init_lenMethod · 0.80
into_refMethod · 0.45

Tested by

no test coverage detected