Re: frame.f_locals['__class__'] -- When does it (not) exist and why?

2014-11-15 Thread kevinarpe
Apologies for previous code example. Yes, the 'def class' should read: 'class'. Writing a sample to better demonstrate the issue made me realize that super() is doing something special. It is injecting the magic '__class__' local. I should rephrase my question: How do I get the declaring class

frame.f_locals['__class__'] -- When does it (not) exist and why?

2014-11-15 Thread kevinarpe
Hello, I am CPython 3.4+ user on Linux. I am writing a little library for myself to improve the traceback module -- print_exc() and friends. I want to include the module name, class name (if possible), and function name. Some background: traceback.print_exc() iterates through traceback object