Examine the object's class in python

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

Examine the object's class in python
case class in python
Examine coverage in Python
Class notation in Python
Find the difference in Python
Getting the arXiv API in Python
perl objects and python class part 2.
Python in the browser: Brython's recommendation
Save the binary file in Python
Landmines hidden in Python class variables
Hit the Sesami API in Python
How to use the __call__ method in a Python class
Get the desktop path in Python
"The easiest Python introductory class" modified
Read PNG chunks in Python (class)
Get the script path in Python
Assignments and changes in Python objects
Hit the web API in Python
6 ways to string objects in Python
I wrote the queue in Python
Calculate the previous month in Python
perl objects and python class part 1.
Get the desktop path in Python
Get the host name in Python
Access the Twitter API in Python
The first step in Python Matplotlib
I wrote the stack in Python
Master the weakref module in Python
Generate a first class collection in Python
Learn the design pattern "Prototype" in Python
Learn the design pattern "Builder" in Python
Load the remote Python SDK in IntelliJ
[Introduction to Python] How to use class in Python?
Python> dir ({})> dict Returns the object's attributes
Check the behavior of destructor in Python
Implement __eq__ etc. generically in Python class
Learn the design pattern "Flyweight" in Python
Try using the Kraken API in Python
Learn the design pattern "Observer" in Python
Learn the design pattern "Memento" in Python
Write the test in a python docstring
Learn the design pattern "Command" in Python
OR the List in Python (zip function)
Tweet using the Twitter API in Python
Learn the design pattern "Visitor" in Python
Playing card class in Python (with comparison)
Learn the design pattern "Bridge" in Python
Check if the URL exists in Python
Learn the design pattern "Mediator" in Python
Associate the table set in python models.py
Learn the design pattern "Decorator" in Python
Run the Python interpreter in a script
The result of installing python in Anaconda
What is "mahjong" in the Python library? ??
Read the file line by line in Python
Read the file line by line in Python
MongoDB for the first time in Python
Learn the design pattern "Iterator" in Python
The basics of running NoxPlayer in Python
How to use __slots__ in Python class
Learn the design pattern "Strategy" in Python