Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #35845
| References | <CA+YdQ_6v3m5JH0PusuYffb9xa=U56sNGKxYmy_w0hU04V8ZvgQ@mail.gmail.com> <CAMZYqRSK13j1QbFyud9hWAHLM2q3-xtp6YKwwPTSwpU+Rop-6g@mail.gmail.com> <7wa9suk21r.fsf@benfinney.id.au> |
|---|---|
| Date | 2012-12-31 01:56 -0800 |
| Subject | Re: father class name |
| From | Chris Rebert <clp2@rebertia.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1495.1356947802.29569.python-list@python.org> (permalink) |
On Mon, Dec 31, 2012 at 1:23 AM, Ben Finney <ben+python@benfinney.id.au> wrote: > Chris Rebert <clp2@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__’. Because the difference between the two (and indeed, the very purpose of the latter) is a topic of intermediate/advanced difficulty, and the OP appears to be a newbie. As I stated, but your quotation omitted: >> Note: I'm oversimplifying things a bit for the sake of understandability. Cheers, Chris
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: father class name Chris Rebert <clp2@rebertia.com> - 2012-12-31 01:56 -0800
csiph-web