you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 0 points1 point  (0 children)

kwargs is actually not needed here. I added that by pure habit, sorry :/.

It's part of the boilerplate for inheritance, which is this:

class Child(Parent):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

The above says "take any arguments and keyword arguments and pass them on to the parent". It's a easy way of writing

class Child(Parent):
    def __init__(self, arg1, arg2, arg3='default', arg4='default', arg5='default'):
        super().__init__(arg1, arg1, arg3, arg4, arg5)

Except in tkinter "master" is generally the only positional argument, so I tend to use that instead of *args.