def __init__(self, owner, offset, size, extra=None):
    if (size < 1):
        raise TypeError('Flag must be at least 1 bit wide')
    if (size > owner._nbits):
        raise TypeError('Flag must fit into owner size')
    self.owner = owner
    self.offset = offset
    self.size = size
    self.extra = extra
    self.mask = (((1 << self.size) - 1) << self.offset)
def __init__(self, owner, offset, size, extra=None):
    if (size < 1):
        raise TypeError('Flag must be at least 1 bit wide')
    if (size > owner._nbits):
        raise TypeError('Flag must fit into owner size')
    self.owner = owner
    self.offset = offset
    self.size = size
    self.extra = extra
    self.mask = (((1 << self.size) - 1) << self.offset)