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

Method get_slice

src/objects/sequence.rs:106–113  ·  view source on GitHub ↗
(&self, py: Python, begin: isize, end: isize)

Source from the content-addressed store, hash-verified

104 /// This is the equivalent of the Python expression `o[begin:end]`
105 #[inline]
106 pub fn get_slice(&self, py: Python, begin: isize, end: isize) -> PyResult<PyObject> {
107 unsafe {
108 result_from_owned_ptr(
109 py,
110 ffi::PySequence_GetSlice(self.as_ptr(), begin as Py_ssize_t, end as Py_ssize_t),
111 )
112 }
113 }
114
115 /// Assign object v to the ith element of o.
116 /// Equivalent to Python statement `o[i] = v`

Callers

nothing calls this directly

Calls 2

result_from_owned_ptrFunction · 0.85
as_ptrMethod · 0.45

Tested by

no test coverage detected