This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wchlm
Recipients ezio.melotti, wchlm
Date 2014-04-09.08:06:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397030793.41.0.486579475537.issue21185@psf.upfronthosting.co.za>
In-reply-to
Content
I observe the following in Python 2.6.1 in CentOS 5.9 and in Python 2.7.5 in MacOS 10.9.2.

A heapified 3-element array containing elements in the order [low, high, medium] fails to print in sorted order, as shown below: 

>>> import heapq
>>> lista = [1, 6, 5, 4]
>>> heapq.heapify(lista)
>>> lista # Gives sorted order, as expected
[1, 4, 5, 6]
>>> 
>>> listb = [1, 6, 5]
>>> heapq.heapify(listb)
>>> listb # Gives unsorted order -- unexpected and presumably a bug
[1, 6, 5]
>>> 
>>> [heapq.heappop(listb) for i in range(len(listb))] # But heappop works
[1, 5, 6]
History
Date User Action Args
2014-04-09 08:06:33wchlmsetrecipients: + wchlm, ezio.melotti
2014-04-09 08:06:33wchlmsetmessageid: <1397030793.41.0.486579475537.issue21185@psf.upfronthosting.co.za>
2014-04-09 08:06:33wchlmlinkissue21185 messages
2014-04-09 08:06:32wchlmcreate