The built-in function object() returns an empty object. This object is the base for all the classes. It holds the built-in properties and methods which are default. It is not possible to add new properties or methods to this object.
o = object() #where o is the object
The object() function doesn't accept any parameters.
The object() function returns a featureless object. And this act as a base for all class.
test = object()
print(type(test))
print(dir(test))
Output:
test = object() print(type(test)) print(dir(test))
# declaring the objects of class object
obj1 = object()
obj2 = object()
# checking for object equality
print ("Is obj1 equal to obj2 : " + str(obj1 == obj2))
# trying to add attribute to object
obj1.name = "GeeksforGeeks"
Output:
Is obj1 equal to obj2 : False