+ 3

Is there any way for an __init__ to get called more than once during program execution if not explicitly called?

7th Jan 2020, 12:15 PM
Tanishq Sangwan
Tanishq Sangwan - avatar
4 Réponses
+ 2
__init__ is called every time when you instantiate a new object of the class.
7th Jan 2020, 2:10 PM
Tibor Santa
Tibor Santa - avatar
+ 3
I don't know, why it is needed to be ran more than once, but when you do: class_name.__init__(object, args) The function __init__ will be called as a normal function.
7th Jan 2020, 12:31 PM
Seb TheS
Seb TheS - avatar
+ 1
Thc
7th Jan 2020, 12:40 PM
Tanishq Sangwan
Tanishq Sangwan - avatar
0
o
8th Jan 2020, 1:07 PM
Ayush