I want something like the .class method in ruby.
'Ruby'.class
# => String
I want to see from which class some instance was created.
'Python'.__class__.__name__
# => str
You can get the class by using __class__
. You can also get the class name by using __class__.__name__
.
Recommended Posts