Add a "key" parameter to bisect* functions?

Giacomo Alzetta giacomo.alzetta at gmail.com
Wed Sep 12 11:54:29 EDT 2012


I've just noticed that the bisect module lacks of the key parameter.

The documentation points to a recipe that could be used to handle a sorted collection, but I think it's an overkill if I want to bisect my sequence only once or twice with a key. Having something like `bisect(sequence, key=my_key)` would be much easier and would conform to the other operations such as max/min/sorted.

Is there some reason behind this lack?



More information about the Python-list mailing list