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


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


2 Answers

New Answer


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.


thank u for the simple answer broo.