I need to get the class (not just the name, the real class ref) from an inspect stack return.
Say i have this:
class excls:
def somemethod():
something = "is happening here"
return something
if i go back with inspect.stack()
i want to get the class reference of the previous entry in the stack, in this case the excls
reference. I looked into to the return of inspect.stack()
but i didnt find anything useful there. If there is an alternative method that allows me to get the class reference of the previous stack it is also welcomened
source https://stackoverflow.com/questions/73514079/inspect-find-class-in-stack
Comments
Post a Comment