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

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -