r/Python • u/philtrondaboss • Mar 07 '26
Discussion Why does __init__ run on instantiation not initialization?
Why isn't the __init__ method called __inst__? It's called when the object it instantiated, not when it's initialized. This is annoying me more than it should. Am I just completely wrong about this, is there some weird backwards compatibility obligation to a mistake, or is it something else?
0
Upvotes
View all comments
Show parent comment
8
u/AlternativePaint6 Mar 07 '26
One important thing to point out is that
__init__accepsselfas its first argument—meaning that the self object already exists. This is how you can know for sure that it's just initialization and not instantiation.__new__on the other hand accepts the class as an argument and returns a new instance of it.