[issue18241] Add unique option to heapq functions

Antoine Pitrou report at bugs.python.org
Mon Jun 17 16:44:02 CEST 2013


New submission from Antoine Pitrou:

In one application, I would like to use a heap as an allocation pool. I also want to check that a given value isn't released twice, therefore that the heap contains unique values. My use case would be solved nicely if heappush() took an optional "unique=False" parameter.

Note that I haven't checked if doing so is possible while maintaining the O(log n) complexity :-)

----------
messages: 191341
nosy: pitrou, rhettinger
priority: low
severity: normal
status: open
title: Add unique option to heapq functions
type: enhancement
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18241>
_______________________________________


More information about the Python-bugs-list mailing list