Message61225
| Author |
jsjoseph |
| Recipients |
| Date |
2006年03月16日.19:26:31 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
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(...) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2008年01月20日 09:59:45 | admin | link | issue1451588 messages |
| 2008年01月20日 09:59:45 | admin | create |
|