python binary search vs dict