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

Method slot_new

crates/vm/src/stdlib/itertools.rs:39–47  ·  view source on GitHub ↗
(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

37 impl PyItertoolsChain {
38 #[pyslot]
39 fn slot_new(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult {
40 let args_list = PyList::from(args.args);
41 Self {
42 source: PyRwLock::new(Some(args_list.to_pyobject(vm).get_iter(vm)?)),
43 active: PyRwLock::new(None),
44 }
45 .into_ref_with_type(vm, cls)
46 .map(Into::into)
47 }
48
49 #[pyclassmethod]
50 fn from_iterable(

Callers

nothing calls this directly

Calls 15

newFunction · 0.85
pyobject_to_opt_usizeFunction · 0.85
into_ref_with_typeMethod · 0.80
get_iterMethod · 0.80
call_special_methodMethod · 0.80
SomeClass · 0.50
ErrClass · 0.50
mapMethod · 0.45
to_pyobjectMethod · 0.45
lenMethod · 0.45
bindMethod · 0.45
is_noneMethod · 0.45

Tested by

no test coverage detected