Python – object()
Python object() built-in function is used to create an empty object.
In this tutorial, we will learn the syntax and usage of object() built-in function with examples.
The syntax of object() function is
The function does not accept any parameters.
1. Create empty object
In the following program, we will create an empty object using object() function.
Run Code Online
myObj = object() print(myObj)
<object object at 0x1046bc1c0>
object is the base for all classes. This object has properties and methods that are common to all objects of other types (builtin classes, or user defined classes).
In this Built-in Functions tutorial, we learned the syntax of the object() built-in function, and how to use this function to create an empty object.