diff -r dd574929b414 -r 1dfe62a9da50 entity.py --- a/entity.py Fri Oct 04 18:16:45 2013 +0200 +++ b/entity.py Tue Oct 08 10:46:06 2013 +0200 @@ -537,7 +537,14 @@ raise NotImplementedError('comparison not implemented for %s' % self.__class__) def __eq__(self, other): - raise NotImplementedError('comparison not implemented for %s' % self.__class__) + if isinstance(self.eid, (int, long)): + return self.eid == other.eid + return self is other + + def __hash__(self): + if isinstance(self.eid, (int, long)): + return self.eid + return super(Entity, self).__hash__() def _cw_update_attr_cache(self, attrcache): # if context is a repository session, don't consider dont-cache-attrs as