Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn heaps library into a more OOP data structure? #71477

Closed
CrazyPython mannequin opened this issue Jun 10, 2016 · 3 comments
Closed

Turn heaps library into a more OOP data structure? #71477

CrazyPython mannequin opened this issue Jun 10, 2016 · 3 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@CrazyPython
Copy link
Mannequin

CrazyPython mannequin commented Jun 10, 2016

BPO 27290
Nosy @rhettinger, @CrazyPython

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/rhettinger'
closed_at = <Date 2016-06-10.22:02:49.713>
created_at = <Date 2016-06-10.21:48:11.852>
labels = ['library']
title = 'Turn heaps library into a more OOP data structure?'
updated_at = <Date 2016-06-11.00:12:44.824>
user = 'https://github.com/CrazyPython'

bugs.python.org fields:

activity = <Date 2016-06-11.00:12:44.824>
actor = 'James.Lu'
assignee = 'rhettinger'
closed = True
closed_date = <Date 2016-06-10.22:02:49.713>
closer = 'rhettinger'
components = ['Library (Lib)']
creation = <Date 2016-06-10.21:48:11.852>
creator = 'James.Lu'
dependencies = []
files = []
hgrepos = []
issue_num = 27290
keywords = []
message_count = 3.0
messages = ['268159', '268161', '268170']
nosy_count = 2.0
nosy_names = ['rhettinger', 'James.Lu']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue27290'
versions = ['Python 3.6']

@CrazyPython
Copy link
Mannequin Author

CrazyPython mannequin commented Jun 10, 2016

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?

@CrazyPython CrazyPython mannequin added the stdlib Python modules in the Lib dir label Jun 10, 2016
@rhettinger
Copy link
Contributor

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.

@rhettinger rhettinger self-assigned this Jun 10, 2016
@CrazyPython
Copy link
Mannequin Author

CrazyPython mannequin commented Jun 11, 2016

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\>


@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant