From c4c7fe6dc0af09c70687e1b8f85f834b80f77d2d Mon Sep 17 00:00:00 2001 From: Haoyu Bai Date: Sun, 5 Jul 2009 16:48:15 +0000 Subject: [PATCH] fix list sorting in py3k [SVN r54675] --- test/list.cpp | 1 + test/list.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/list.cpp b/test/list.cpp index b573dcf7..8ddf8574 100644 --- a/test/list.cpp +++ b/test/list.cpp @@ -109,6 +109,7 @@ void exercise(list x, object y, object print) print("sorted:"); x.pop(2); // make sorting predictable + x.pop(2); // remove [1,2] so the list is sortable in py3k x.sort(); print(x); diff --git a/test/list.py b/test/list.py index c01f9268..6c1b8aef 100644 --- a/test/list.py +++ b/test/list.py @@ -97,9 +97,9 @@ removing 666 reversing... ['y', 'x', X(3), [1, 2], '.', 'o', 'l', 'l', 'e', 'h'] sorted: -[[1, 2], '.', 'e', 'h', 'l', 'l', 'o', 'x', 'y'] +['.', 'e', 'h', 'l', 'l', 'o', 'x', 'y'] reverse sorted: -['y', 'x', 'o', 'l', 'l', 'h', 'e', '.', [1, 2]] +['y', 'x', 'o', 'l', 'l', 'h', 'e', '.'] ''' def run(args = None):