def _get_generality(key, mask):
    """Count the number of Xs in the key-mask pair.

    For example, there are 32 Xs in ``0x00000000/0x00000000``::

        >>> _get_generality(0x0, 0x0)
        32

    And no Xs in ``0xffffffff/0xffffffff``::

        >>> _get_generality(0xffffffff, 0xffffffff)
        0
    """
    xs = ~key & ~mask
    return sum(1 for i in range(32) if xs & 1 << i)
