Finding the name of a class

Aug. 1, 2006
3:22 p.m.
Given a class:
class foo(object): pass
how can I find its name, such as:
b = foo print something(b) 'foo'
I'm writing a trace() decorator for the sake of practice, and am trying to print the name of the class that a traced method belongs to. This seems like it should be easy, but I think I've been staring at the problem too long. -- Kirk Strauser

6984
Age (days ago)
6985
Last active (days ago)
10 comments
7 participants
participants (7)
-
bruno desthuilliers
-
Bruno Desthuilliers
-
Kent Johnson
-
Kirk Strauser
-
Larry Bates
-
Tim Chase
-
Ziga Seilnacht