Finding defining class in a decorator

lcaamano lcaamano at
Tue May 9 20:20:17 CEST 2006

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.


Luis P Caamano
Atlanta, GA USA

More information about the Python-list mailing list