views:

206

answers:

1

In older python version when you create a class in python, it can inherit from object which is as far I understand a special built-in python element that allow your object to be a new-style object.

What about newer version (> 3.0 and 2.6)? I googled about the class object but I get so much result (for an obvious reasons). Any hint?

Thank!

+6  A: 

You don't need to inherit from object to have new style in python 3. All classes are new-style.

SilentGhost
Thank you :) I looked through online book (A byte of Pyhton) and a lot of pyhton's doc but never found my answer clearly...
thomas
What about Python 2.6?
luc
python 2.6 behaves as python 2.x
SilentGhost
Notice that this means all classes inherit from `object` regardless if typing an explicit `(object)` or not in Python 3.1
kaizer.se