Python object() With Examples

Python object() function returns a new featureless object. Python is an object-oriented programming language and object is the base of all the classes.

Python object()

Python object() function doesn’t accept any argument. Since it returns a new instance of an object, all its methods are present in other classes too.

There is hardly any practical use to call this function since it’s featureless. The object instance returned doesn’t have a __dict__ dictionary, so we can’t assign any arbitrary attributes to it.


Notice that dir() function output doesn’t have __dict__ as an attribute.

Let’s see what happens when we try to assign an attribute to this object instance.


You can checkout complete python script and more Python examples from our GitHub Repository.

Reference: Official Documentation

By admin

Leave a Reply

%d bloggers like this: