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

Method tolist

crates/stdlib/src/array.rs:958–965  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

956
957 #[pymethod]
958 fn tolist(&self, vm: &VirtualMachine) -> PyResult<Vec<PyObjectRef>> {
959 let array = self.read();
960 let mut v = Vec::with_capacity(array.len());
961 for obj in array.iter(vm) {
962 v.push(obj?);
963 }
964 Ok(v)
965 }
966
967 #[pymethod]
968 fn fromlist(zelf: &Py<Self>, list: PyListRef, vm: &VirtualMachine) -> PyResult<()> {

Callers 15

test_tofromlistMethod · 0.45
test_bufferMethod · 0.45
test_tolistMethod · 0.45
test_indexMethod · 0.45
test_countMethod · 0.45
test_tolistMethod · 0.45
_check_releasedMethod · 0.45
test_reversedMethod · 0.45
test_toreadonlyMethod · 0.45
test_half_floatMethod · 0.45
ndarray_printFunction · 0.45
verifyMethod · 0.45

Calls 4

readMethod · 0.45
lenMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45

Tested by 15

test_tofromlistMethod · 0.36
test_bufferMethod · 0.36
test_tolistMethod · 0.36
test_indexMethod · 0.36
test_countMethod · 0.36
test_tolistMethod · 0.36
_check_releasedMethod · 0.36
test_reversedMethod · 0.36
test_toreadonlyMethod · 0.36
test_half_floatMethod · 0.36
ndarray_printFunction · 0.36
verifyMethod · 0.36