(&self, attr: &str)
| 25 | } |
| 26 | |
| 27 | fn __getitem__(&self, attr: &str) -> PyResult<PyObject> { |
| 28 | let gil = Python::acquire_gil(); |
| 29 | let py = gil.python(); |
| 30 | if let Some(data) = self.as_ref().get(attr) { |
| 31 | from_data(py, data) |
| 32 | } else { |
| 33 | Err(pyo3::exceptions::PyTypeError::new_err("Key Error")) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | fn __delitem__(&mut self, attr: &str) -> PyResult<()> { |
| 38 | self.as_mut().remove(attr); |