[issue21185] heapq fails to print in sorted order for certain inputs

wchlm report at bugs.python.org
Wed Apr 9 10:34:59 CEST 2014


wchlm added the comment:

Hi sahutd,

You may be right. I was keying off a stackoverflow example (http://stackoverflow.com/questions/12373837/heapq-module-python) that might have been misleading.

In fact, the Python documentation never does say what a printed heapified array is suppose to look like -- how it unwinds the tree structure into a linear list.

But from the above example I assumed it was supposed to print the sorted order, and again my assumption is quite possibly wrong.

It might be useful, as a documentation issue, to say what a printed heapified array is supposed to look like.

----------

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


More information about the Python-bugs-list mailing list