From the book I'm studying, at times the author uses __init__
as being a first function of a class. This function (and others) always have self
as one of the variables (something that I still do not understand why). When should (and why) use __init__
functions within (some) classes?
When I create a parental class or even a class that will not have hierarchy relationships between it and other classes, I am required to name it as:
class Batata(object):
Is this object
mandatory at some point? If so, when?