[pypy-svn] r71394 - pypy/trunk/pypy/tool

arigo at codespeak.net arigo at codespeak.net
Mon Feb 22 09:17:20 CET 2010


Author: arigo
Date: Mon Feb 22 09:17:18 2010
New Revision: 71394

Modified:
   pypy/trunk/pypy/tool/stdlib_opcode.py
Log:
Improve __cmp__ (hash clashes during annotations cause it to be
called a bit randomly).


Modified: pypy/trunk/pypy/tool/stdlib_opcode.py
==============================================================================
--- pypy/trunk/pypy/tool/stdlib_opcode.py	(original)
+++ pypy/trunk/pypy/tool/stdlib_opcode.py	Mon Feb 22 09:17:18 2010
@@ -61,8 +61,8 @@
         return i, self.index
 
     def __cmp__(self, other):
-        return cmp(self.sortkey(), other.sortkey())
-
+        return (cmp(self.__class__, other.__class__) or
+                cmp(self.sortkey(), other.sortkey()))
 
 opdescmap = {}
 



More information about the Pypy-commit mailing list