def bytestobits(bytesource):
    """
    Breaks a given iterable of bytes into an iterable of boolean
    values representing those bytes as unsigned integers.

    >>> [ x for x in bytestobits(b"\\x01\\x30") ]
    [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0]
    """
    for value in bytesource:
        for bitplusone in range(8, 0, -1):
            bitindex = bitplusone - 1
            nextbit = 1 & value >> bitindex
            yield nextbit
