@classmethod
def from_mask(celf, mask):
    """converts a bitmask to a frozenset of EXCEPT.xxx values."""
    result = set()
    for e in celf.__members__.values():
        if e.mask & mask != 0:
            result.add(e)
    return frozenset(result)
