(&self, py: Python, value: V)
| 182 | /// Determine if o contains value. this is equivalent to the Python expression `value in o` |
| 183 | #[inline] |
| 184 | pub fn contains<V>(&self, py: Python, value: V) -> PyResult<bool> |
| 185 | where |
| 186 | V: ToPyObject, |
| 187 | { |
| 188 | let r = value.with_borrowed_ptr(py, |ptr| unsafe { |
| 189 | ffi::PySequence_Contains(self.as_ptr(), ptr) |
| 190 | }); |
| 191 | match r { |
| 192 | 0 => Ok(false), |
| 193 | 1 => Ok(true), |
| 194 | _ => Err(PyErr::fetch(py)), |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | /// Return the first index i for which o[i] == value. |
| 199 | /// This is equivalent to the Python expression `o.index(value)` |
nothing calls this directly
no test coverage detected