__new__(cls, name, bases, clsdict): clsobj = super().__new__(cls, name, bases, clsdict) sig = make_signature(clsobj._fields) setattr(clsobj, '__signature__', sig) return clsobj class Structure(metaclass=StructMeta): _fields = [] def __init__(self, *args, **kwargs): bound = self.__signature__.bind( *args, **kwargs) for name, val in bound.arguments.items(): setattr(self, name, val) Read _fields attribute and make a proper signature out of it