r/Python 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

22 comments sorted by

View all comments

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.