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
0
u/ottawadeveloper Mar 07 '26
This is why I suspect the difference exists - you can't call an instance method without an instance in Python because there's no magic
thisobject like in Java. Therefore instantiation has to be done before __ init __ (self) via __ new __ (cls).