Counting primes in a range whose digits are all prime
Please read PEP8 and apply its advice; this will make your code look like Python code to others. Mainly, avoid code blocks on the same line as their conditions, and avoid cramming too many assignments on the same line.

You can also make your predicate function return a single value, as the first element of the returned tuple can be computed from the second (mainly p[0] is p[1] is None). You could also use the more common values -1, 0 and 1 and add an else clause in your xbinsearch loop to raise an exception. This would have caught the case where val == b in your usage.

Lastly, bisect should be the module to reach for when dealing with binary search in Python. In fact, having your list of primes ready, the code should be:

def get_total_primes(a, b):
    low = bisect.bisect_left(primes, a)
    high = bisect.bisect_left(primes, b)
    return high - low


And if you ever want to include the upper bound, you can:

def get_total_primes_inclusive(a, b):
    low = bisect.bisect_left(primes, a)
    high = bisect.bisect_right(primes, b)
    return high - low