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 jsjoseph, rhettinger, splitscreen
Date 2008-03-24.08:26:40
SpamBayes Score 0.028188843
Marked as misclassified No
Message-id <1206347202.09.0.574423771557.issue1451588@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry, am closing this RFE because its not the best way to use the 
bisect tools.  The cmp function is going away in Py3.0 in favor of key 
functions.  Yet, even those do not play nicely with bisect because the 
function results are not stored between successive calls to bisect.  
Accordingly, it is almost always better to arrange the records in a 
decorated style so that they can be compared directly and not through a 
cmp or key function.

The one misgiving is that is feels odd to be able to sort by a key 
function but not maintain that order or search that ordering using the 
bisect module.  Yet, there is a simple reason for the difference -- sort
() works on the entire sequence at once and can take advantage of the 
single key function call per element -- in contrast, the bisect 
functions have finer granularity and the cmp/key functions no longer 
make sense.
History
Date User Action Args
2008-03-24 08:26:42rhettingersetspambayes_score: 0.0281888 -> 0.028188843
recipients: + rhettinger, jsjoseph, splitscreen
2008-03-24 08:26:42rhettingersetspambayes_score: 0.0281888 -> 0.0281888
messageid: <1206347202.09.0.574423771557.issue1451588@psf.upfronthosting.co.za>
2008-03-24 08:26:41rhettingerlinkissue1451588 messages
2008-03-24 08:26:40rhettingercreate