r/Python • u/declspecl • 3d ago
Discussion Constructors: __init__, __new__, both, neither?
Hi all, I'm doing some research on what programmers believe is the class constructor in Python. I made a poll here: https://strawpoll.com/05ZdzVzdmn6 and would appreciate all responses, thanks!
0
Upvotes
0
u/M4mb0 2d ago
The constructor in python is the
__call__
method of the meta class, which by default calls__new__
and__init__
, but can be customized to do something else entirely.