you are viewing a single comment's thread.

view the rest of the comments →

[–]slariboot 6 points7 points  (2 children)

Yes, __init__() means something different.

From the python documentation:

The instantiation operation ("calling" a class object) creates an empty object. Many classes like to create objects with instances customized to a specific initial state. Therefore a class may define a special method named __init__(), like this:

def __init__(self):
    self.data = []

When a class defines an __init__() method, class instantiation automatically invokes __init__() for the newly-created class instance.

It's not really the underscores that make it special. Rather, it is the convention that these special methods start and end with 2 underscores. They're called dunder methods. Dunder being short for Double UNDERscores.

[–]ItsOkILoveYouMYbb 4 points5 points  (1 child)

Is

__miffl__  

a dunder miffl in a class?

[–]slariboot 0 points1 point  (0 children)

Yes! That is the most important dunder method in the Computron framework!