<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def updateitem(self, key, new_val):
 """ Update the priority value of an existing item. Raises ``KeyError`` if key is not in the pqdict. """

        if key not in self._position:
            raise KeyError(key)
        self[key] = new_val