def compare_range(a, b):
    """
    >>> compare_range(1, "-10")
    True
    >>> compare_range(1, "10-")
    False
    >>> compare_range(20, "-10")
    False
    >>> compare_range(1, "10-20")
    False
    >>> compare_range(1.0, "0-1.0")
    True
    >>> compare_range(100, "-")
    True
    >>> compare_range("b", "a-z")
    True
    >>> compare_range("b", "b")
    True
    >>> compare_range("b", "a")
    False
    """
    if '-' not in b:
        return a == type(a)(b)
    bmin, bmax = b.split('-', 1)
    if bmin not in (None, '') and type(a)(bmin) > a:
        return False
    if bmax not in (None, '') and type(a)(bmax) < a:
        return False
    return True
