This is an excellent solution. The only problem is that it misses the case that one of the number in the array is actually -inf or inf. I am not a python expert, but in case of Java if you are using Integer.MAX_VALUE or Integer.MIN_VALUE, it will be a problem.

Can anyone give me an idea about the boundary cases? like if noms[low] <= target <<nums[mid] , why we can use double "<=" here?
I am really confused about this in binary search problem. If someone could piont me to some reference to clear this question, that would be great !