-1

I am a newbie. I've seen tk.Frame.__init__(self, *args, **kwargs) this code here. I am really confused. What exactly this would do?

dead day
  • 27
  • 6

1 Answers1

1

This is fundamental part of python's standard way of creating subclasses. It doesn't really have anything specific to do with tkinter. However, if you subclass a tkinter class -- like with any class -- this will make sure that the base class is properly initialized.

What you're seeing, however, is an older style of initializing a base class. For python 3.x and beyond you should be using something like super().__init__(*args, **kwargs). See super and the description of Class objects in the standard python documentation.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685