A
alf
Hi,
is there a more elegant way to get o.__class__.__name__. For instance I
would imagine name(o).
is there a more elegant way to get o.__class__.__name__. For instance I
would imagine name(o).
alf said:Hi,
is there a more elegant way to get o.__class__.__name__. For instance I
would imagine name(o).
'int'alf said:Hi,
is there a more elegant way to get o.__class__.__name__. For instance I
would imagine name(o).
Carl said: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
decided to stick to o.__class__.__name__ for readibility.alf said:Hi,
is there a more elegant way to get o.__class__.__name__. For instance I
would imagine name(o).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.