Simplify Task.__eq__() and __ne__().
authorZac Medico <zmedico@gentoo.org>
Thu, 30 Sep 2010 22:58:36 +0000 (15:58 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 30 Sep 2010 22:58:36 +0000 (15:58 -0700)
Supposedly performance it better with the simpler implementation.
This reverts commit 59f50a0bf9bdbb3aab4eee097e12bf32eeb12274.

pym/_emerge/Task.py

index dfb560f6ad332e6cfb63af0a56be777623748756..31788b57695df480e22d7754ea2ff80e8af1f156 100644 (file)
@@ -12,14 +12,10 @@ class Task(SlotObject):
                        raise NotImplementedError(self)
 
        def __eq__(self, other):
-               if self.__class__ is not other.__class__:
-                       return False
-               return self._get_hash_key() == other._get_hash_key()
+               return self._get_hash_key() == other
 
        def __ne__(self, other):
-               if self.__class__ is not other.__class__:
-                       return True
-               return self._get_hash_key() != other._get_hash_key()
+               return self._get_hash_key() != other
 
        def __hash__(self):
                hash_value = getattr(self, "_hash_value", None)