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

2014-04-09 Thread wchlm

wchlm added the comment:

All fair enough. I see the error of my ways. I am closing the case with a 
Resolution of "invalid." Thanks

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 
<http://bugs.python.org/issue21185>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-04-09 Thread wchlm

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 
<http://bugs.python.org/issue21185>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-04-09 Thread wchlm

New submission from wchlm:

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]

--
components: Devguide
messages: 215805
nosy: ezio.melotti, wchlm
priority: normal
severity: normal
status: open
title: heapq fails to print in sorted order for certain inputs
type: behavior
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue21185>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15117] Please document top-level sqlite3 module variables

2012-06-20 Thread wchlm

New submission from wchlm :

sqlite3 top-level variables, such as version, sqlite_version, version_info, and 
sqlite_version_info are all useful for Python users of the module -- even 
essential at times. Yet there is no mention of them in the Py 2.7.3 
documentation. 

dir(sqlite3) reveals a longer list. It would be good if someone with a deeper 
knowledge of the module could assemble a list of useful items and add them to 
the sqlite3 documentation.

--
assignee: docs@python
components: Documentation
messages: 163285
nosy: docs@python, shenkin
priority: normal
severity: normal
status: open
title: Please document top-level sqlite3 module variables
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue15117>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com