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

Method set_slice

src/objects/sequence.rs:139–151  ·  view source on GitHub ↗
(&self, py: Python, i1: isize, i2: isize, v: &PyObject)

Source from the content-addressed store, hash-verified

137 /// This is the equivalent of the Python statement `o[i1:i2] = v`
138 #[inline]
139 pub fn set_slice(&self, py: Python, i1: isize, i2: isize, v: &PyObject) -> PyResult<()> {
140 unsafe {
141 err::error_on_minusone(
142 py,
143 ffi::PySequence_SetSlice(
144 self.as_ptr(),
145 i1 as Py_ssize_t,
146 i2 as Py_ssize_t,
147 v.as_ptr(),
148 ),
149 )
150 }
151 }
152
153 /// Delete the slice in sequence object o from i1 to i2.
154 /// equivalent of the Python statement `del o[i1:i2]`

Callers

nothing calls this directly

Calls 2

error_on_minusoneFunction · 0.85
as_ptrMethod · 0.45

Tested by

no test coverage detected