Sep-30-2021, 07:15 PM
I create a class and I added a code that download a file and parse it in the __init__ .
for each object I create an object from my class it calls the init method.
what I want is to automatically call a certain function once for first object created and the remaining objects, they shall use the parameters that was parsed.
The init method is not going to do the job.
I know that I can do this by creating a method in the class and explicitly call it for first object only.
I was wondering if something already exists as magic method that can do the job implicitly.
for each object I create an object from my class it calls the init method.
what I want is to automatically call a certain function once for first object created and the remaining objects, they shall use the parameters that was parsed.
The init method is not going to do the job.
I know that I can do this by creating a method in the class and explicitly call it for first object only.
I was wondering if something already exists as magic method that can do the job implicitly.