I'm looking for documentations regarding __init__'s second argument.
In the snippet below, I instantiated an object of class test with a dict object, and actual content of this dict object was passed onto the test object via the second argument of the __init__ method.
So I think I know how this works and this is a really neat feature, however I would like to learn more about this but haven't been able to find any page that documents how this works in detail.
Could you please link me to a documentation that covers this, or explain to me how it works? Much appreciated!
aDict = {
'a': 1,
'b': 2
}
class test:
def __init__(self, data):
self.data = data
new_aDict = test(aDict)
new_aDict.data
{'a': 1, 'b': 2}