@staticmethod
def _bits(n):
    """ Iterate over the bits in n.

            e.g. bits(44) yields at 2, 3, 5
        """
    if not n >= 0:
        raise ValueError()
    pos = 0
    while n:
        if n & 1:
            yield pos
        n = n // 2
        pos += 1
