All the Python built-ins are subclasses of object
and I come across many user-defined classes which are too. Why? What is the purpose of the class object<
The short version is that classic classes, which didn't need a superclass, had limitations that couldn't be worked around without breaking a lot of old code. So they created the concept of new-style classes which subclass from object
, and now you can do cool things like define properties, and subclassing dict
is no longer an exercise in pain and strange bugs.
The details are in section 3.3 of the Python docs: New-style and classic classes.