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
Date 2006-12-19.21:43:17
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I'm -1 on this patch.  At first blush it would seem nice to progagate sort's notion of a key= function; however, sort() is an all at once operation that can guarantee the function gets called only once per key.  In contrast, bisect() is more granualar so consecutive calls may need to invoke the same key= function again and again.  This is almost always the the-wrong-way-to-do-it (the key function should be precomputed and either stored separately or follow a decorate-sort pattern).  By including custom sorting in bisect's API we would be diverting users away from better approaches.

A better idea would be to create a recipe for a SortedList class that performed pre-calculated custom keys upon insertion and maintained an internal, decorated list.
History
Date User Action Args
2007-08-23 16:12:23adminlinkissue1619060 messages
2007-08-23 16:12:23admincreate