[New-bugs-announce] [issue36857] bisect should support descending order

John Belmonte report at bugs.python.org
Wed May 8 14:11:15 EDT 2019


New submission from John Belmonte <john at neggie.net>:

because "list.pop()"

use case: maintain large ordered list and efficiently remove min item

list.pop() is O(1) but yields the max item.  There is no efficient removal of the min item.

list is by far the fastest collection to use with insort().  While deque offers O(1) popleft(), insort() performance with deque is not acceptable.

Lack of descending support in bisect necessitates workarounds such as using negative-valued items, which hurts code readability and moreover assumes that values are numbers.

----------
components: Library (Lib)
messages: 341921
nosy: John Belmonte
priority: normal
severity: normal
status: open
title: bisect should support descending order
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36857>
_______________________________________


More information about the New-bugs-announce mailing list