'D.largest_key() -> the largest key; raise KeyError if D is empty.'

def largest_key(self):

    try:
        return self._sorted_keys[(-1)]
    except IndexError:
        raise KeyError('largest_key():    dictionary    is    empty')
