This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients gvanrossum, karlb, rhettinger, timehorse
Date 2008-03-12.22:40:54
SpamBayes Score 0.11275934
Marked as misclassified No
Message-id <1205361656.51.0.10236538993.issue1619060@psf.upfronthosting.co.za>
In-reply-to
Content
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 .
History
Date User Action Args
2008-03-12 22:40:56rhettingersetspambayes_score: 0.112759 -> 0.11275934
recipients: + rhettinger, gvanrossum, timehorse, karlb
2008-03-12 22:40:56rhettingersetspambayes_score: 0.112759 -> 0.112759
messageid: <1205361656.51.0.10236538993.issue1619060@psf.upfronthosting.co.za>
2008-03-12 22:40:55rhettingerlinkissue1619060 messages
2008-03-12 22:40:55rhettingercreate