def popitem(self):
try:<EOL><INDENT>key = next(iter(self))<EOL><DEDENT>except StopIteration:<EOL><INDENT>raise KeyError<EOL><DEDENT>value = self[key]<EOL>del self[key]<EOL>return key, value<EOL>
D.popitem() -> (k, v), remove and return some (key, value) pair
           as a 2-tuple; but raise KeyError if D is empty.