alf wrote: > Hi, > is there a more elegant way to get o.__class__.__name__. For instance I > would imagine name(o).
def name_of_type(o): return o.__class__.__name__ name_of_type(o) Carl Banks P.S. name(o) suggests it's the name of the object, not the type P.P.S. you could use type(o).__name__ but it doesn't work for old-style classes -- http://mail.python.org/mailman/listinfo/python-list