Python bisect with a key