@classmethod
def to_mask(celf, flags):
    """converts a set of EXCEPT.xxx values to a bitmask."""
    result = 0
    for e in celf.__members__.values():
        if e in flags:
            result |= e.mask
    return result
