Author: Maciej Fijalkowski <fij...@gmail.com> Branch: Changeset: r64157:d36d874c476a Date: 2013-05-15 15:43 +0200 http://bitbucket.org/pypy/pypy/changeset/d36d874c476a/
Log: test and fix uneven comparisons diff --git a/pypy/module/array/interp_array.py b/pypy/module/array/interp_array.py --- a/pypy/module/array/interp_array.py +++ b/pypy/module/array/interp_array.py @@ -100,11 +100,11 @@ return space.w_True if comp_op == LT or comp_op == LE: if arr1.len < arr2.len: - return space.w_False + return space.w_True + return space.w_False + if arr1.len > arr2.len: return space.w_True - if arr1.len > arr2.len: - return space.w_False - return space.w_True + return space.w_False UNICODE_ARRAY = lltype.Ptr(lltype.Array(lltype.UniChar, hints={'nolength': True})) diff --git a/pypy/module/array/test/test_array.py b/pypy/module/array/test/test_array.py --- a/pypy/module/array/test/test_array.py +++ b/pypy/module/array/test/test_array.py @@ -552,6 +552,15 @@ assert (a >= c) is False assert (c >= a) is True + a = self.array('i', [-1, 0, 1, 42, 0x7f]) + assert not a == 2*a + assert a != 2*a + assert a < 2*a + assert a <= 2*a + assert not a > 2*a + assert not a >= 2*a + + def test_reduce(self): import pickle a = self.array('i', [1, 2, 3]) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit