def words(byte_stream):
    """A generator that delivers a stream of 16 bit numbers, given a stream of bytes"""
    low = None
    for b in byte_stream:
        if low is not None:
            yield low + (b << 8)
            low = None
        else:
            low = b
    if low is not None:
        yield low
