Finding defining class in a decorator

2006-05-09 Thread lcaamano
We have a tracing decorator that automatically logs enter/exits to/from functions and methods and it also figures out by itself the function call arguments values and the class or module the function/method is defined on. Finding the name of the class where the method we just entered was defined

Re: Finding defining class in a decorator

2006-05-09 Thread Ziga Seilnacht
lcaamano wrote: We have a tracing decorator that automatically logs enter/exits to/from functions and methods and it also figures out by itself the function call arguments values and the class or module the function/method is defined on. Finding the name of the class where the method we just

Re: Finding defining class in a decorator

2006-05-09 Thread lcaamano
Nice. I had to call _getframe(2) to account for the wrapper but the idea seems to work OK, that is, save the name of the decorator's original caller at definition time while creating the wrapper function. Much better than doing that at runtime. Thanks -- Luis P Caamano Atlanta, GA USA --