0
xor for__init__ function between superclass and subclass
hey there. the question is about object attributes(self.something) imagine u have a superclass with some attributes. and u have lots of subclasses with different attributes. each subclass needs its own attributes plus the superclass's attributes. the problem is: unlike other functions, __init__ function can't be overwritten by subclass. and even if there is a way to overwrite it, then the superclass's attributes are lost! so how can a subclass have its own attributes plus its superclass's attributes?
1 Respuesta
+ 1
just try for sub class :
def __init__(*args):
super().__init__(*args)