def class_rebuilder(cls): # decorator def init(self): logger.info("[%s] Applying ID to endopoint:%s of type '%s'" % (self.__class__.__name__, name, idtype)) self.set_method_id(name, idtype) # logger.debug("New init %s %s" % (name, idtype)) super(cls, self).__init__() NewClass = Meta.metaclassing( cls, cls.__name__ + '_withid', {'__init__': init}) return NewClass