def replace(self, key, value):
        "Sets key with value if key already exists."
        assert key in self, 'Key does not exist!'
        super().__setitem__(key, value)
Sets key with value if key already exists.
recipes/Python/577825_Rudimentary_Database_Engine/recipe-577825.py