Skip to main content
added 369 characters in body
Source Link
poke
  • 391.8k
  • 80
  • 596
  • 632

The reason is that super()super() only operates on new-style classesnew-style classes, which in the 2.x series means extending from object.object:

>>> class X(object): def a(self): print 'a' >>> class Y(X): def a(self): super(Y, self).a() print 'b' >>> c = Y() >>> c.a() a b 

The reason is that super() only operates on new-style classes, which in the 2.x series means extending from object.

The reason is that super() only operates on new-style classes, which in the 2.x series means extending from object:

>>> class X(object): def a(self): print 'a' >>> class Y(X): def a(self): super(Y, self).a() print 'b' >>> c = Y() >>> c.a() a b 
Source Link
Serafina Brocious
  • 30.6k
  • 12
  • 92
  • 115

The reason is that super() only operates on new-style classes, which in the 2.x series means extending from object.