What is the difference between old style and new style classes in Python? When should I use one or the other?
Guido has written The Inside Story on New-Style Classes, a really great article about new-style and old-style class in Python.
Python 3 has only new-style class. Even if you write an 'old-style class', it is implicitly derived from object
.
New-style classes have some advanced features lacking in old-style classes, such as super
, the new C3 mro, some magical methods, etc.