Raymond Hettinger <[EMAIL PROTECTED]> added the comment: Guido, what do you think about this one?
It is easy to do and has been requested several times in various forums. The seeming reasonable basis for the request is that sort and bisect should fit together like a nut and bolt -- it is somewhat odd to be able to sort a list by a key function but not be able to search or insert according to the same key. My main reservation is that the existence of the API would tend to encourage bad design. Elsewhere, the intent of the key function is to be cheaper than a cmp function (such as with sort() which calls the key function once per element instead of many times for cmp). But with successive bisect/insort calls, a key function could be called multiple times for the same value. The same issue also applies to heapq: http://bugs.python.org/issue1158313 and http://bugs.python.org/issue1162363 . ---------- assignee: rhettinger -> gvanrossum nosy: +gvanrossum _____________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1619060> _____________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com