Jakub M.
Jakub M.

Reputation: 33827

Python: base class for all other classes

In Python, what is the base class for all other classes (real Base), that all other classes inherit from?

Upvotes: 3

Views: 574

Answers (2)

Jakob Bowyer
Jakob Bowyer

Reputation: 34698

All new style classes inherit from object.

New-style classes were introduced in Python 2.2 to unify classes and types. Here there is a nice description of what a new style class is. – Paolo Moretti

Upvotes: 4

utdemir
utdemir

Reputation: 27216

It is object. At least in 2.7 and 3.1.

>>> class A():
...     pass
... 
>>> isinstance(A, object)
True

Upvotes: 1

Related Questions