English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The object() function returns an object with no features, which is the basis of all classes.
The syntax of object() is:
o = object()
The object() function does not accept any parameters.
The object() function returns an object with no features.
test = object() print(type(test)) print(dir(test))
Output result
<class 'object'> __class__, __delattr__, __dir__, __doc__, __eq__, __format__, __ge__, __getattribute__, __gt__, __hash__, __init__, __le__, __lt__, __ne__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__
Here, an object is createdtest.
In the program, we usetype()Get the type of the object.
Similarly, we usedir()Get all properties. These properties (properties and methods) are common to all instances of Python classes.