I am editing some code that is being called by another system that I do not control. This system initializes my class from a few different places. I need to perform different things depending on where my class is called from. Is there a way I can find where my object is being initialized?
A.py
:
class InitializerA:
def calling_function(self):
Called()
class InitializerB:
def calling_function(self):
Called()
B.py
:
class Called:
def __init__(self):
# I want to know here whether it is being called by InitializerA or InitializerB