My objective is to stimulate a sequence diagram of an application for this I need the information about a caller and callee class names at runtime. I can successfully retrie
Instead of indexing the return value of inspect.stack(), one could use the method inspect.currentframe(), which avoids the indexing.
prev_frame = inspect.currentframe().f_back the_class = prev_frame.f_locals["self"].__class__ the_method = prev_frame.f_code.co_name