[pypy-svn] r13923 - pypy/dist/pypy/rpython

arigo at codespeak.net arigo at codespeak.net
Sun Jun 26 12:16:30 CEST 2005


Author: arigo
Date: Sun Jun 26 12:16:29 2005
New Revision: 13923

Modified:
   pypy/dist/pypy/rpython/lltype.py
Log:
Performance of rtyper.


Modified: pypy/dist/pypy/rpython/lltype.py
==============================================================================
--- pypy/dist/pypy/rpython/lltype.py	(original)
+++ pypy/dist/pypy/rpython/lltype.py	Sun Jun 26 12:16:29 2005
@@ -1,4 +1,4 @@
-import weakref
+import weakref, operator
 import py
 from pypy.rpython.rarithmetic import r_uint
 from pypy.tool.uid import Hashable
@@ -22,6 +22,8 @@
             del seeing[seeingkey]
     return safe
 
+safe_equal = saferecursive(operator.eq, True)
+
 class frozendict(dict):
 
     def __hash__(self):
@@ -32,8 +34,8 @@
 
 class LowLevelType(object):
     def __eq__(self, other):
-        return self.__class__ is other.__class__ and self.__dict__ == other.__dict__
-    __eq__ = saferecursive(__eq__, True)
+        return self.__class__ is other.__class__ and (
+            self is other or safe_equal(self.__dict__, other.__dict__))
 
     def __ne__(self, other):
         return not (self == other)



More information about the Pypy-commit mailing list