Re: [Python-Dev] Adding key and reverse args to bisect

2009-06-11 Thread Aahz
On Thu, Jun 11, 2009, David A. Barrett wrote: > > I propose adding the key parameter to the bisect.bisect routines. > This would allow it to be used on lists with an ordering other than > the one "natural" to the contained objects. Raymond addressed your actual question, but please post suggestion

Re: [Python-Dev] Adding key and reverse args to bisect

2009-06-11 Thread Raymond Hettinger
[David A. Barrett] I propose adding the key parameter to the bisect.bisect routines. This would allow it to be used on lists with an ordering other than the one "natural" to the contained objects. Algorithmically, the bisect routines are the wrong place to do key lookups. If you do many calls

[Python-Dev] Adding key and reverse args to bisect

2009-06-11 Thread David A. Barrett
I propose adding the key parameter to the bisect.bisect routines. This would allow it to be used on lists with an ordering other than the one "natural" to the contained objects. (and anywhere else it makes sense in the bisect module). Would this be easy enough to do? It looks like the main diff