Another option would be to include `type(self)` in `self._key`, and remove the check from `__eq__`.