def bytestobits(bytesource):
 for b in bytesource:
  value = unpackbyte(b)
  for bitplusone in range(8, 0, (-1)):
   bitindex = (bitplusone - 1)
   nextbit = (1 & (value >> bitindex))
   (yield nextbit)

def bytestobits ( bytesource ) : for b in bytesource : value = unpackbyte ( b ) for bitplusone in range ( 8 , 0 , ( - 1 ) ) : bitindex = ( bitplusone - 1 ) nextbit = ( 1 & ( value >> bitindex ) ) ( yield nextbit )
breaks a given iterable of bytes into an iterable of boolean values representing those bytes as unsigned integers .