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

Method __getitem__

crates/vm/src/builtins/genericalias.rs:222–232  ·  view source on GitHub ↗
(zelf: PyRef<Self>, needle: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

220 }
221
222 fn __getitem__(zelf: PyRef<Self>, needle: PyObjectRef, vm: &VirtualMachine) -> PyResult {
223 let new_args = subs_parameters(
224 zelf.to_owned().into(),
225 zelf.args.clone(),
226 zelf.parameters.clone(),
227 needle,
228 vm,
229 )?;
230
231 Ok(Self::new(zelf.origin.clone(), new_args, false, vm).into_pyobject(vm))
232 }
233
234 #[pymethod]
235 fn __dir__(&self, vm: &VirtualMachine) -> PyResult<PyList> {

Callers

nothing calls this directly

Calls 5

subs_parametersFunction · 0.85
newFunction · 0.85
to_ownedMethod · 0.45
cloneMethod · 0.45
into_pyobjectMethod · 0.45

Tested by

no test coverage detected