(&self, py: Python, value: V)
| 199 | /// This is equivalent to the Python expression `o.index(value)` |
| 200 | #[inline] |
| 201 | pub fn index<V>(&self, py: Python, value: V) -> PyResult<usize> |
| 202 | where |
| 203 | V: ToPyObject, |
| 204 | { |
| 205 | let r = value.with_borrowed_ptr(py, |ptr| unsafe { |
| 206 | ffi::PySequence_Index(self.as_ptr(), ptr) |
| 207 | }); |
| 208 | if r == -1 { |
| 209 | Err(PyErr::fetch(py)) |
| 210 | } else { |
| 211 | Ok(r as usize) |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | /// Return a fresh list based on the Sequence. |
| 216 | #[inline] |
nothing calls this directly
no test coverage detected