MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / get_item

Method get_item

src/objects/sequence.rs:94–101  ·  view source on GitHub ↗
(&self, py: Python, index: isize)

Source from the content-addressed store, hash-verified

92 /// Return the ith element of the Sequence. Equivalent to python `o[index]`
93 #[inline]
94 pub fn get_item(&self, py: Python, index: isize) -> PyResult<PyObject> {
95 unsafe {
96 result_from_owned_ptr(
97 py,
98 ffi::PySequence_GetItem(self.as_ptr(), index as Py_ssize_t),
99 )
100 }
101 }
102
103 /// Return the slice of sequence object o between begin and end.
104 /// This is the equivalent of the Python expression `o[begin:end]`

Callers

nothing calls this directly

Calls 2

result_from_owned_ptrFunction · 0.85
as_ptrMethod · 0.45

Tested by

no test coverage detected