[pypy-svn] r14917 - pypy/branch/pypy-translation-snapshot/objspace/std

arigo at codespeak.net arigo at codespeak.net
Fri Jul 22 16:44:59 CEST 2005


Author: arigo
Date: Fri Jul 22 16:44:58 2005
New Revision: 14917

Modified:
   pypy/branch/pypy-translation-snapshot/objspace/std/listobject.py
Log:
Merged rev 14916 from the trunk.


Modified: pypy/branch/pypy-translation-snapshot/objspace/std/listobject.py
==============================================================================
--- pypy/branch/pypy-translation-snapshot/objspace/std/listobject.py	(original)
+++ pypy/branch/pypy-translation-snapshot/objspace/std/listobject.py	Fri Jul 22 16:44:58 2005
@@ -571,12 +571,16 @@
         self.w_key = w_key
         self.w_item = w_item
 
+# NOTE: all the subclasses of TimSort should inherit from a common subclass,
+#       so make sure that only SimpleSort inherits directly from TimSort.
+#       This is necessary to hide the parent method TimSort.lt() from the
+#       annotator.
 class SimpleSort(TimSort):
     def lt(self, a, b):
         space = self.space
         return space.is_true(space.lt(a, b))
 
-class CustomCompareSort(TimSort):
+class CustomCompareSort(SimpleSort):
     def lt(self, a, b):
         space = self.space
         w_cmp = self.w_cmp
@@ -590,7 +594,7 @@
             raise
         return result < 0
 
-class CustomKeySort(TimSort):
+class CustomKeySort(SimpleSort):
     def lt(self, a, b):
         assert isinstance(a, KeyContainer)
         assert isinstance(b, KeyContainer)



More information about the Pypy-commit mailing list