Python 2 has two kinds of classes: old-style (classic) and new-style. New-style classes are classes that directly or indirectly inherit from object. Only new-style classes can use Python's advanced features, such as slots, descriptors, and properties. Many of these are used by Django. However, classes are still old-style by default for compatibility reasons.
In Python 3, old-style classes don't exist anymore. As seen in the following table, even if you don't explicitly mention any parent classes, the object class will be present as a base. So, all classes are new-style:
Python 2 |
Python 3 |
>>> class CoolMixin: ... pass >>> CoolMixin.__bases__ () |
>>> class CoolMixin:... pass>>> CoolMixin.bases(<class ... |