On Mon, 31 Dec 2012 20:23:44 +1100, Ben Finney wrote: > Chris Rebert <c...@rebertia.com> writes: > >> By contrast, in the first part of the *expression* >> `haha(object).theprint()`, you passed an argument (namely, `object`). >> Since __init__() wasn't expecting any arguments whatsoever, you >> therefore got an error. > > Why is everyone talking about the initialiser, ‘__init__’? > > When: > >> >>>> haha(object).theprint() >> > Traceback (most recent call last): >> > File "<stdin>", line 1, in <module> >> > TypeError: object.__new__() takes no parameters > > The error is talking about the constructor, ‘__new__’.
Good point. I think we do a disservice to newbies when we (inadvertently) discourage them from reading the tracebacks generated by an error. The traceback clearly talks about a __new__ method. I don't believe that talking about the constructor __new__ is so complicated that we should ignore the actual error and go of on a wild- goose chase about the initialiser __init__, especially since adding an __init__ method to the class *won't solve the problem*. Sorry Chris, I think you dropped the ball on this one and gave an overtly misleading answer :-( -- Steven -- http://mail.python.org/mailman/listinfo/python-list