[New-bugs-announce] [issue24660] Heapq + functools.partial : TypeError: unorderable types

Марк Коренберг report at bugs.python.org
Sat Jul 18 14:00:50 CEST 2015


New submission from Марк Коренберг:

>>> import heapq
>>> from functools import partial
>>> qwe = [(0, lambda x: 42), (0, lambda x: 56)]
>>> heapq.heapify(qwe)
>>>
>>> qwe = [(0, partial(lambda x: 42)), (0, partial(lambda x: 56))]
>>> heapq.heapify(qwe)
Traceback (most recent call last):
  File "/usr/lib/python3.4/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
TypeError: unorderable types: functools.partial() < functools.partial()


So it is not realiable to use heapq if element of the array is (int, callable)

----------
components: Library (Lib)
messages: 246894
nosy: mmarkk
priority: normal
severity: normal
status: open
title: Heapq + functools.partial : TypeError: unorderable types
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24660>
_______________________________________


More information about the New-bugs-announce mailing list