Hi @wrosen02 ,
What @mtf says is correct. The
__init__ method doesn't assign memory. In fact, if you design a
class that has no
__init__ method, you can still create an instance of that
In this example,
Minimal_Class has no
__init__ method, but we can create an instance of it anyway ...
return "Instance of Minimal_Class"
mc = Minimal_Class()
Instance of Minimal_Class
class does have an
__init__ method, it will execute automatically when you instantiate the
class. The purpose of an
__init__ method is to perform any tasks that should be performed when an instance is created. It is up to the designer of the
class to decide what those tasks are.
By the way,
object has an
__init__ method, so if you do this ...
class will inherit that default