Say I have this code:
class B:
def __init__(self, **fields):
self.__dict__.update(fields)
class A(B):
def __init__(self, **fields):
super().__init__(**fields)
What is going on here? Why are updating the __dict__
of B
in this way?
So if we instantiated A(c=1, d=2)
, what happens?