[issue27295] heaps library does not have support for max heap

2016-06-12 Thread James Lu
James Lu added the comment: It's not a very pythoniic way to simply negate the value. Plus, the majority of heap users want performance (heap was made for speed), so a C version would be much better. On Sat, Jun 11, 2016 at 4:39 PM, Raymond Hettinger wrote: > > Raymond Hettinger added the com

[issue27295] heaps library does not have support for max heap

2016-06-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry James, we don't grow the APIs without sufficient demonstrated need; otherwise, we end-up with API sprawl. People with actual use cases haven't requested behavior (and the occasional one-off gets by negating the numeric argument). That is why the max

[issue27295] heaps library does not have support for max heap

2016-06-11 Thread SilentGhost
Changes by SilentGhost : -- nosy: +rhettinger, stutzbach type: -> enhancement versions: +Python 3.6 ___ Python tracker ___ ___ Python

[issue27295] heaps library does not have support for max heap

2016-06-11 Thread James Lu
New submission from James Lu: Both max heaps and min heaps have uses in algorithms. Some algorithms require both. Why doesn't the heapq library support max heaps (not including the private _heapify_max() method)? -- components: Library (Lib) messages: 268211 nosy: James.Lu priority: no