Python Forum
function that run once for all objects
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function that run once for all objects
#1
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.
Reply


Messages In This Thread
function that run once for all objects - by mr_byte31 - Sep-30-2021, 07:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  AWS Boto3 - objects function PythonDialer 0 96 Yesterday, 11:50 AM
Last Post: PythonDialer

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020