On Sat, Sep 29, 2012 at 1:17 PM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > No. Only add code that works and that you need. Arbitrarily adding calls > to the superclasses "just in case" may not work: > > > > py> class Spam(object): > ... def __init__(self, x): > ... self.x = x > ... super(Spam, self).__init__(x) > ... > py> x = Spam(1) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "<stdin>", line 4, in __init__ > TypeError: object.__init__() takes no parameters
That's a good thing. We've gone from code that doesn't call the initializer and leaves the object in a potentially invalid state (silently!), to code that calls the initializer and then fails (loudly). -- Devin -- http://mail.python.org/mailman/listinfo/python-list