def bits2positions(bits):
    """Converts an integer in the range 0 <= bits < 2**61 to a list of integers
    in the range 0 through 60 inclusive indicating the positions of the nonzero bits.

    Args:
        bits:
            int. An integer in the range 0 <= bits < 2 ** 61

    Returns:
        A list of integers in the range 0 though 60 inclusive.
    """
    return list(i for i in range(61) if (2 ** i) & bits > 0)