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

Function tuple_index

crates/vm/src/builtins/genericalias.rs:342–344  ·  view source on GitHub ↗
(vec: &[PyObjectRef], item: &PyObject)

Source from the content-addressed store, hash-verified

340
341#[inline]
342fn tuple_index(vec: &[PyObjectRef], item: &PyObject) -> Option<usize> {
343 vec.iter().position(|element| element.is(item))
344}
345
346fn is_unpacked_typevartuple(arg: &PyObject, vm: &VirtualMachine) -> PyResult<bool> {
347 if arg.class().is(vm.ctx.types.type_type) {

Callers 3

subs_tvarsFunction · 0.85
subs_parametersFunction · 0.85

Calls 3

isMethod · 0.80
positionMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected