Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35844

Re: father class name

From Ben Finney <ben+python@benfinney.id.au>
Subject Re: father class name
Date 2012-12-31 20:23 +1100
References <CA+YdQ_6v3m5JH0PusuYffb9xa=U56sNGKxYmy_w0hU04V8ZvgQ@mail.gmail.com> <CAMZYqRSK13j1QbFyud9hWAHLM2q3-xtp6YKwwPTSwpU+Rop-6g@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1494.1356945835.29569.python-list@python.org> (permalink)

Show all headers | View raw


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__’.

-- 
 \          “It's dangerous to be right when the government is wrong.” |
  `\                                   —Francois Marie Arouet Voltaire |
_o__)                                                                  |
Ben Finney

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: father class name Ben Finney <ben+python@benfinney.id.au> - 2012-12-31 20:23 +1100
  Re: father class name Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-01 03:24 +0000

csiph-web