(&self, py: Python)
| 36 | /// Returns the number of objects in sequence. This is equivalent to Python `len()`. |
| 37 | #[inline] |
| 38 | pub fn len(&self, py: Python) -> PyResult<isize> { |
| 39 | let v = unsafe { ffi::PySequence_Size(self.0.as_ptr()) }; |
| 40 | if v == -1 { |
| 41 | Err(PyErr::fetch(py)) |
| 42 | } else { |
| 43 | Ok(v as isize) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | /// Return the concatenation of o1 and o2. Equivalent to python `o1 + o2` |
| 48 | #[inline] |