0

I came across the following code snippet while reading some code in Python:

class Base(object):
    def __init__(self):
        print "Base created"

What is this object that the above mentioned class is inheriting from? Now, I do understand that this is a 'new style' object defined from Python 2.2. However, I'm not sure I understand what exactly this object is. I have seen other classes in Python too inheriting from object.

Is this a class defined in Python?

Manas Chaturvedi
  • 5,210
  • 18
  • 52
  • 104
  • 2
    possible duplicate of [What is the difference between old style and new style classes in Python?](http://stackoverflow.com/questions/54867/what-is-the-difference-between-old-style-and-new-style-classes-in-python) – pacholik Sep 08 '15 at 15:23
  • 1
    Look at https://docs.python.org/2/library/functions.html?highlight=object#object – Fernando Matsumoto Sep 08 '15 at 15:31
  • possible duplicate of [Python's new-style classes' base - \`object\` and \`type\`](http://stackoverflow.com/questions/10493655/pythons-new-style-classes-base-object-and-type) – Maciej Lach Sep 09 '15 at 09:03

0 Answers0