[Python-Dev] Re: Priority queue (binary heap) python code

François Pinard pinard@iro.umontreal.ca
20 Jul 2002 08:24:45 -0400


[Guido van Rossum]

> Oh, and maybe we can borrow a few lines of François's description of
> the algorithm. :-)

Borrow liberally!  I would prefer that nothing worth remains un-borrowed
from mine, so I can happily get rid of my copy when the time comes! :-)

> I propose to call it heapq.py.  (Got a better name?  Now or never.)

I like `heapq' as it is not an English common name, like `heap' would be,
so less likely to clash with user chosen variable names!  This principle
should be good in general.

Sub-classing `heapq' from `list' is a good idea!

P.S. - In other languages, I have been using `string' a lot, and this has
been one of the minor irritations when I came to Python, that it forced
me away of that identifier; so I'm now using `text' everywhere, instead.
Another example is the name `socket', which is kind of reserved from the
module name, I never really know how to name variables holding sockets :-).

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard