Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r46938:a3a90cb98864
Date: 2011-08-30 04:56 +0200
http://bitbucket.org/pypy/pypy/changeset/a3a90cb98864/

Log:    Add a test for range().sort(key=). It works, but you have not to
        blink when looking at the list_sort implementation of ranges.

diff --git a/pypy/objspace/std/test/test_rangeobject.py 
b/pypy/objspace/std/test/test_rangeobject.py
--- a/pypy/objspace/std/test/test_rangeobject.py
+++ b/pypy/objspace/std/test/test_rangeobject.py
@@ -89,6 +89,9 @@
         assert not self.not_forced(r)
         r.sort()
         assert r == range(1, 100) + [999]
+        r = range(10)
+        r.sort(key=lambda x: -x)
+        assert r == range(9, -1, -1)
 
     def test_pop(self):
         r = range(10)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to