(&self, vm: &VirtualMachine)
| 396 | |
| 397 | #[pymethod] |
| 398 | fn popitem(&self, vm: &VirtualMachine) -> PyResult<(PyObjectRef, PyObjectRef)> { |
| 399 | let (key, value) = self.entries.pop_back().ok_or_else(|| { |
| 400 | let err_msg = vm |
| 401 | .ctx |
| 402 | .new_str(ascii!("popitem(): dictionary is empty")) |
| 403 | .into(); |
| 404 | vm.new_key_error(err_msg) |
| 405 | })?; |
| 406 | Ok((key, value)) |
| 407 | } |
| 408 | |
| 409 | #[pyclassmethod] |
| 410 | fn __class_getitem__(cls: PyTypeRef, args: PyObjectRef, vm: &VirtualMachine) -> PyGenericAlias { |
nothing calls this directly
no test coverage detected