<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rename_object(self, old, new):
 """Replace the name of an object by a new one."""

        self._objects.replace(old, new)
        pairs = self._pairs
        pairs |= {(new, p) for p in self._properties
            if (old, p) in pairs and not pairs.remove((old, p))}