I understand that, with a singleton situation, you can perform such an operation as:
spam == eggs
and if spam and eggs>
As orokusaki comments, "if neither instance has a primary key, it will return true always". If you want this to work, you could extend your model like so:
def __eq__(self, other):
eq = isinstance(other, self.__class__) and self._get_pk_val() == other._get_pk_val()
if eq and self._get_pk_val() is None:
return id(self) == id(other)
return eq