Message61225
The 'bisect' module provides functions for finding the
proper insertion point of an item in a sorted list.
The sort() function for lists supports passing in a
custom comparison function, however none of the
functions in bisect() support this. The method used by
bisect to find the proper insertion point is not
documented, but I guess the module relies on a natural
ordering for the items, or on the items of the list
implementing __cmp__.
I suggest adding a 5th argument, with keyword 'cmp', to
the functions in the 'bisect' module that would allow
supplying a custom comparison function, as for 'sort'.
bisect_left( list, item[, lo[, hi]][,cmp])
bisect_right( list, item[, lo[, hi]][,cmp])
bisect(...)
insort_left( list, item[, lo[, hi]][,cmp])
insort_right( list, item[, lo[, hi]][,cmp])
insort(...) |
|
Date |
User |
Action |
Args |
2008-01-20 09:59:45 | admin | link | issue1451588 messages |
2008-01-20 09:59:45 | admin | create | |
|