@ExposedMethod(doc = BuiltinDocs.dict_popitem_doc) final PyObject stringmap_popitem() { Iterator<Entry<Object, PyObject>> it = table.entrySet().iterator(); if (!it.hasNext()) { throw Py.KeyError("popitem(): dictionary is empty"); } PyTuple tuple = itemTuple(it.next()); it.remove(); return tuple; }