Add a key function to the bisect module.