[issue4948] Make heapq work with all mutable sequences

2018-06-15 Thread Brett Cannon
Brett Cannon added the comment: FYI I had a teacher reach out to me who wanted to use heapq as an example of functions-based API that worked without resorting to OOP but ran into this issue of heapq being limited to lists. -- nosy: +brett.cannon _

[issue4948] Make heapq work with all mutable sequences

2009-01-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: With no compelling use cases, it's not worth slowing down the module. Am sticking with the original design decision. -- resolution: -> rejected status: open -> closed ___ Python tracker

[issue4948] Make heapq work with all mutable sequences

2009-01-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: array.array is terribly slow. It is optimized for space, not speed. ___ Python tracker ___ ___ Python-bug

[issue4948] Make heapq work with all mutable sequences

2009-01-14 Thread Benoit Boissinot
Benoit Boissinot added the comment: I was thinking about array.array. I don't know if it would be faster than using a list, but it seemed elegant to be able to do a heap on it anyway. ___ Python tracker

[issue4948] Make heapq work with all mutable sequences

2009-01-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: This was discussed at the outset and the decision was a conscious one. Do you have any particular use cases in mind (what other mutable sequences do you reach for when you need a heap)? Or is this just a general discussion on generalization? -- ass

[issue4948] Make heapq work with all mutable sequences

2009-01-14 Thread Benoit Boissinot
New submission from Benoit Boissinot : Generalize heapq to work with all kind of mutable sequences. It should be investigated PySequence_SetItem is a lot slower than PyList_SET_ITEM (same for GET_ITEM and GET_SIZE). -- components: Extension Modules messages: 79859 nosy: bboissin severity