Why __init__(self, ....)?


#1


Why is "self" even necessary, since it's there by default?


Replace this line with your code.


#2

Self isn't there by default. The first argument is always the object instance, yes; however, it doesn't have to be called self. You could call it anything you like but it's convention is to call it self. It helps with readability if nothing else.

As for why do we have to explicitly state self? Here is what Guido van Rossum has to say:


#3

very enlightening! Thanks for taking the time to respond.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.