In Python, consider I have the following code:
>>> class SuperClass(object):
def __init__(self, x):
self.x = x
>>> class SubClass(SuperClass):
def __init__(self, y):
self.y = y
# how do I initialize the SuperClass __init__ here?
Python (until version 3) supports "old-style" and new-style classes. New-style classes are derived from 'object' and are what you are using, and invoke their base class through super(), e.g.
class X(object): def __init__(self, x): pass def doit(self, bar): pass class Y(X): def __init__(self): super(Y, self).__init__(123) def doit(self, foo): return super(Y, self).doit(foo)
Because python knows about old- and new-style classes, there are different ways to invoke a base method, which is why you've found multiple ways of doing so.
For completeness sake, old-style classes call base methods explicitly using the base class, i.e.
def doit(self, foo): return X.foo(self, foo)
But since you shouldn't be using old-style anymore, I wouldn't care about this too much.
Python 3 only knows about new-style classes (no matter if you derive from object or not).