For my exception class, I would like to know if the function that created the exception object instance is a method, and if so, show the class name.
So, in the init method of my exception class, I get the name of the calling function:
frame, module, line, function, context, index = inspect.stack()[1]
But is there a way to get the class name (if any) of the calling function?
source
share