I've started to learn python about 2 weeks ago and I'm trying to grasp the concept of classes and subclasses which lead me to read the code of others.
I've noticed that sometimes, the programmer defines subclasses of some classes, and he would __init__
some of them but not all of them. I wonder what's the criteria to define a subclass and choose to use __init__
rather than inherit from the class.
Edit: It is not that I don't understand __init__
, it's that I don't understand why one would use a subclass and use different variables compared to the class. Why use a subclass instead of a new class in that case?