Locating a sequence in a sorted array
I am afraid you're approach is too complicated. Just create a function that finds the first occurrence of an element using a binary search, an another function that finds the last one. And then you can write:

def find_indexes(xs, x)
  start = find_first_index(xs, x)
  return ((start, find_last_index(xs, x, start=start)) if start else None)


For a simple implementation of find_first_index and find_last_index, check bisect.bisect_left and bisect.bisect_right source code here.