ID EN
Built-in Functions

type

Python 3.11

With one argument, return the type of an object. The return value is a type object and generally the same object as returned by object.__class__.

Syntax

PYTHON
class type(object)

Examples

Example 1
PYTHON
>>> class X:
...     a = 1
...
>>> X = type('X', (), dict(a=1))

See Also

object.__class__ isinstance() class __name__ __bases__ object __dict__ type