0

in the class concept of python, it states that __init __ initializes the class, which I understood as setting defaults to the class. However, I bumped into a new concept called __new __, which states that it is used to control the creation of the class. I have seen several explanations saying that __new __ also returns an instance, but I am also confused about what that is returning and to where.

Can someone clarify these points, please?

Gokul G.K
  • 110
  • 1
  • 8
lei
  • 21
  • 1
  • 3
  • @metatoaster This might actually be a very good start for a canonical answer to the direct question of what is `__new__`. All other questions are a little indirect. – Bharel Aug 04 '22 at 02:20
  • 2
    @Bharel if we are asking "what is `__new__`", [this thread](https://stackoverflow.com/questions/57421318/whats-new-by-default-in-python-3) should be the canonical. – metatoaster Aug 04 '22 at 03:25

0 Answers0