Understanding metaclass and inheritance in Python [duplicate]
This question already has an answer here: What are metaclasses in Python? 16 answers I have some confusion regarding meta-classes. With inheritance class AttributeInitType(object): def __init__(self,**kwargs): for name, value in kwargs.items(): setattr(self, name, value) class Car(AttributeInitType): def __init__(self,**kwargs): super(Car, self).__init__(**kwargs) @property def description(self): return "%s %s %s %s" % (self.color, self.year, self.make, self.model) c = Car(make='Toyota', model='Prius', year=2005, color='green') print c.description With meta class class AttributeInitType(type):