when does __new__ becomes executed ? | Sololearn: Learn to code for FREE!

0

when does __new__ becomes executed ?

does __new__ be executed before or after __init__ and does it be executed once or more ?

4/10/2021 1:33:09 AM

0MR4N

2 Answers

New Answer

+2

It is called whenever a new instance of the the class is created. It instantiates the object (self) and then passes self along with the other arguments that were passed in to the __init__ method.

+1

thank u for the simple answer broo.