(&self, py: Python, attr_name: N, value: V)
| 59 | /// This is equivalent to the Python expression 'self.attr_name = value'. |
| 60 | #[inline] |
| 61 | fn setattr<N, V>(&self, py: Python, attr_name: N, value: V) -> PyResult<()> |
| 62 | where |
| 63 | N: ToPyObject, |
| 64 | V: ToPyObject, |
| 65 | { |
| 66 | attr_name.with_borrowed_ptr(py, move |attr_name| { |
| 67 | value.with_borrowed_ptr(py, |value| unsafe { |
| 68 | err::error_on_minusone(py, ffi::PyObject_SetAttr(self.as_ptr(), attr_name, value)) |
| 69 | }) |
| 70 | }) |
| 71 | } |
| 72 | |
| 73 | /// Deletes an attribute. |
| 74 | /// This is equivalent to the Python expression 'del self.attr_name'. |
no test coverage detected