Message73425
import heapq
class foo:
def __init__(self):
self.timeout = 0
def __le__(self, other):
return self.timeout <= other.timeout
heap = []
heapq.heappush(heap, foo())
heapq.heappush(heap, foo())
This code on Python 2.x works without problems, by using Python3.0-RC1
it raises the following exception:
heapq.heappush(heap, foo())
TypeError: unorderable types: foo() < foo()
Note that the previous 3.0 beta didn't have such problem. |
|
Date |
User |
Action |
Args |
2008-09-19 13:47:31 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola |
2008-09-19 13:47:31 | giampaolo.rodola | set | messageid: <1221832051.64.0.219061878163.issue3908@psf.upfronthosting.co.za> |
2008-09-19 13:47:30 | giampaolo.rodola | link | issue3908 messages |
2008-09-19 13:47:28 | giampaolo.rodola | create | |
|