I'm looking for a clear explanation of why my base classes must extend object
if I want to use super
# Without extending object, this code will fail with
# TypeError: must be type, not classobj
class A(object):
def __init__(self):
print "Called A.__init__"
class AChild(A):
def __init__(self):
super(AChild, self).__init__()
print "Called AChild.__init__"
AChild()
This works as expected, but if you remove object
it throws the exception mentioned. I'm using Python 2.7.8. Feel free to link me to any related questions, but I didn't find a good answer with a quick search