Understanding Super() in python -
class seaofbtcapp(tk.tk): def __init__(self, *args, **kwargs): tk.tk.__init__(self, *args, **kwargs) container = tk.frame(self) hello trying understand objects , classes. using tkinter author has created class inherits tk() class of tkinter , proceeds write own __init__ method assume overrides parent class' __init__. author initialises parents original tk.tk.__init__ method.
could author have used super().__init__(*args, **kwargs) achieve same result?
yes, believe author have used super() .
the main advantage of super comes multiple inheritance, this may interest you
Comments
Post a Comment