Trying to figure out how this code is working.
I understand that **kwargs returns a dictionary and the get() function searches the dict for a given key and returns a default value if not found.
However in the code I don't understand is if the get() method is searching for example: "clock" or self.clock or both.
def update(self, *args, **kwargs):
self.screen = kwargs.get("screen",self.screen)
self.clock = kwargs.get("clock",self.clock)
self.active = kwargs.get("active",self.active)
Here is an example call to this method:
debug.update(active = numActive)
From my understanding, the variable numActive is passed through the update method as active and then as **kwargs which is then searched for via the get() method. Couldn't I just remove the use of kwargs seeing as I know how many parameters are needed?
Any help with understanding is appreciated.