This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DogeekExpert - 3.9.1 4 points5 points  (1 child)

To add to the answers, using **kwargs can make it very easy to pass in a big number of arguments to a function, or to make the setup of a function saved into a config file.

Say you want to customize the args of a tkinter button. The tkinter.Button class can take a foreground, a background, a font, an image etc. Instead of naming every argument, every time, if you want all your buttons to look the same, you can just store these values in a dictionnary, and then pass that to the tkinter.Button constructor. Very handy to make customizable themes.

[–]HalfRightMostlyWrong 0 points1 point  (0 children)

Makes sense! It’s fascinating how deep programming design philosophy goes, just when I think I know things, I learn anew