object() in Python
Overview
The object() method returns a featureless object as the base for all classes. This object cannot be extended with additional properties or methods.
Transform Your Career
Choose from our industry-leading programs designed for career success
Modern Software and AI Engineering Program
Master full-stack development with AI integration
+1000 moreModern Data Science and ML with specialisation in AI
Advanced data science techniques with AI specialization
+1000 moreAdvanced AIML with Specialisation in Agentic AI
Deep dive into AIML with focus on Agentic systems
+1000 moreDevOps, Cloud & AI Platform Engineering
Build and manage AI-powered cloud infrastructure
+1000 moreAI Engineering Advanced Certification by IIT-Roorkee
Premier AI engineering certification from IIT-Roorkee
Syntax of object() function in Python
The syntax of object() is:
Parameters of object() function in Python
There are no parameters accepted by object() in Python.
Return Values of object() function in Python
The object() function returns a featureless object.
Code:
Output:
Scaler Placement Report and Statistics
Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.
Example of object() function in Python
Let us see what object() in Python is through an example:
Code:
Output:
Explanation:
In the above example, we assigned o1 and o2 with the object(), which are located at different locations. We print their values and try to find whether the two objects are the same. As we can see, the output returns a False due to the difference in values.
What is an Object in Python?
An object in Python is a real-life entity, something that can help define different items, people, places, etc., in the real world. In Python, the object is an instance of a class that has actual values.
Python treats everything as an object - variables, functions, lists, and so on. Every item belongs to a certain class. For example, an integer variable is a member of the integer class.
For a better understanding of the concept of objects, consider an example of a class of cars. Cars can have different models, brands, and colors. If we were to distinguish a set of cars based on these 3 features, these three would be the properties of a class, and we can further have different objects that define a particular car. You can understand the concept better by seeing the image below.

Syntax:
Example:
Output:
Explanation:
In the above code, we have created a Car class that consisted of three attributes color, brand, type, and display function. We created the object of the car class called red. Using the object along with the .dot operator, we accessed the class function.
Turn Learning into Career Growth
More Examples
Here are a few ways in which you can leverage object()in Python:
Code:
Output:
Explanation:
In the above example, we learned how to display the type, and the attributes of the instance initiated using the object() function.
How object() function in Python Works?
Consider the example of object() in Python shown in the above section. We used type() in the program to determine the type of the object. Similarly, we used dir() to retrieve all of the characteristics. These attributes (properties and methods) are shared by all Python class instances.
Conclusion
- The object() function returns an object with no features and acts as the base for all classes.
- object() in Python does not accept parameters.
- object() in Python does not return any value.
- We use dir() to get the characteristics of the object in Python.
- We use type() to get the type of the object.
See Also
Other functions similar to object() in Python that you can refer to:
- all()
- bytes()
- delattr()
- exec()
- dir()
- type()




