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.

classification
Title: Turn heaps library into a more OOP data structure?
Type: Stage:
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: James.Lu, rhettinger
Priority: normal Keywords:

Created on 2016-06-10 21:48 by James.Lu, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg268159 - (view) Author: James Lu (James.Lu) * Date: 2016-06-10 21:48
The heapq library uses a list or other mutable sequence time to represent a heap. Since Python is a highly OOP language, why not make heaps their own data type?
msg268161 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2016-06-10 22:02
The main reason is that there would be very little benefit.  Lists are a very efficient data structure and the heap manipulations are also very cheap.
msg268170 - (view) Author: James Lu (James.Lu) * Date: 2016-06-11 00:12
Even a wrapper class would be helpful, it's simply more pythonic.

On Fri, Jun 10, 2016 at 6:02 PM, Raymond Hettinger <report@bugs.python.org>
wrote:

>
> Raymond Hettinger added the comment:
>
> The main reason is that there would be very little benefit.  Lists are a
> very efficient data structure and the heap manipulations are also very
> cheap.
>
> ----------
> assignee:  -> rhettinger
> nosy: +rhettinger
> resolution:  -> rejected
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue27290>
> _______________________________________
>
History
Date User Action Args
2022-04-11 14:58:32adminsetgithub: 71477
2016-06-11 00:12:44James.Lusetmessages: + msg268170
2016-06-10 22:02:49rhettingersetstatus: open -> closed

nosy: + rhettinger
messages: + msg268161

assignee: rhettinger
resolution: rejected
2016-06-10 21:48:11James.Lucreate