Highlights §
- Most Python programmers misinterpret the
__init__()
magic method in Python OOP. They think that it creates a new object, i.e., allocates memory to it. (View Highlight)
- When we create ANY object in Python, the
__init__()
method NEVER allocates memory to it. (View Highlight)
- As the name suggests,
__init__()
only assigns value to an object’s attributes, i.e., initialize the attributes. (View Highlight)
- Instead, it’s the
__new__()
magic method that creates a new object and allocates memory to it. (View Highlight)
- (View Highlight)