diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-06-17 21:25:35 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-06-17 21:25:35 (GMT) |
commit | 2ba198d2fbd8d4dd33d2c40af012d622eb03c18f (patch) | |
tree | 863cc1709d50fb8ea12a05281f5db766be4c4efe /Lib | |
parent | 35c8658a74d9b51c6c4755514b02fe3f9d6bb6b8 (diff) | |
download | cpython-2ba198d2fbd8d4dd33d2c40af012d622eb03c18f.zip cpython-2ba198d2fbd8d4dd33d2c40af012d622eb03c18f.tar.gz cpython-2ba198d2fbd8d4dd33d2c40af012d622eb03c18f.tar.bz2 |
Remove 2.6 compatibility code:
now heapqueue items must implement the "<" operator.
The compatibility code could not work: all 3.0 objects have a __lt__ method
(which returns NotImplemented)
Twisted will have to adapt its DelayedCall class.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_heapq.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_heapq.py b/Lib/test/test_heapq.py index fba4fd7..484ab48 100644 --- a/Lib/test/test_heapq.py +++ b/Lib/test/test_heapq.py @@ -198,7 +198,8 @@ class TestHeapC(TestHeap): module = c_heapq def test_comparison_operator(self): - # Issue 3501: Make sure heapq works with both __lt__ and __le__ + # Issue 3501: Make sure heapq works with both __lt__ + # For python 3.0, __le__ alone is not enough def hsort(data, comp): data = [comp(x) for x in data] self.module.heapify(data) @@ -215,9 +216,8 @@ class TestHeapC(TestHeap): return self.x >= other.x data = [random.random() for i in range(100)] target = sorted(data, reverse=True) - print("HASATTR", hasattr(LE(0), "__lt__"), LE(0).__lt__) self.assertEqual(hsort(data, LT), target) - self.assertEqual(hsort(data, LE), target) + self.assertRaises(TypeError, data, LE) #============================================================================== |