[pypy-commit] pypy default: Make it possible to have multiple subclasses of TimSort mixed together, if

fijal noreply at buildbot.pypy.org
Wed Sep 25 19:50:29 CEST 2013


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r67099:4daed7bb7a01
Date: 2013-09-25 16:03 +0200
http://bitbucket.org/pypy/pypy/changeset/4daed7bb7a01/

Log:	Make it possible to have multiple subclasses of TimSort mixed
	together, if necessary

diff --git a/rpython/rlib/listsort.py b/rpython/rlib/listsort.py
--- a/rpython/rlib/listsort.py
+++ b/rpython/rlib/listsort.py
@@ -8,7 +8,7 @@
 ##         Adapted from CPython, original code and algorithms by Tim Peters
 
 def make_timsort_class(getitem=None, setitem=None, length=None,
-                       getitem_slice=None, lt=None):
+                       getitem_slice=None, lt=None, base_class=object):
 
     if getitem is None:
         def getitem(list, item):
@@ -30,7 +30,7 @@
         def lt(a, b):
             return a < b
 
-    class TimSort(object):
+    class TimSort(base_class):
         """TimSort(list).sort()
 
         Sorts the list in-place, using the overridable method lt() for comparison.


More information about the pypy-commit mailing list