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


Groups > comp.lang.python > #65163

Re: __init__ is the initialiser

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.034
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'constructor': 0.09; 'creation,': 0.09; 'instance.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'try:': 0.09; '[1].': 0.16; '__init__,': 0.16; '__new__': 0.16; 'finney': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.18; 'header :User-Agent:1': 0.23; 'controlling': 0.24; 'header:X-Complaints- To:1': 0.27; 'writes:': 0.31; 'subject:the': 0.34; 'tool': 0.35; 'but': 0.35; 'received:com.au': 0.36; 'clear': 0.37; 'skip:o 20': 0.38; 'ben': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'new': 0.61; "you're": 0.61; 'provide': 0.64; 'more': 0.64; 'skip:\xe2 10': 0.65; '8bit%:21': 0.69; 'internet': 0.71; '8bit%:43': 0.74; '8bit%:46': 0.78; 'ethan': 0.84; 'furman': 0.84; 'received:125': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Ben Finney <ben+python@benfinney.id.au>
Subject Re: __init__ is the initialiser
Date Sat, 01 Feb 2014 13:10:21 +1100
References <52EC0E3C.5070900@stoneleaf.us> <20140131224507.GA5454@cskk.homeip.net> <85ob2rhfxd.fsf@benfinney.id.au> <52EC3C14.8080806@stoneleaf.us>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host vmx15867.hosting24.com.au
X-Public-Key-ID 0xBD41714B
X-Public-Key-Fingerprint 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-gpg.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
Cancel-Lock sha1:RkYMrzqAM7fHaOqTUwZ2sNEOmYs=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6241.1391220636.18130.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391220636 news.xs4all.nl 2829 [2001:888:2000:d::a6]:60794
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65163

Show key headers only | View raw


Ethan Furman <ethan@stoneleaf.us> writes:

> On 01/31/2014 03:47 PM, Ben Finney wrote:
> > I suggest:
> >
> >      Called automatically by the constructor “__new__” during
> >      instance creation, to initialise the new instance.
>
> But __new__ does not call __init__, type does [1].

My apologies, you're right and that's made clear at
<URL:file:///usr/share/doc/python3.3/html/reference/datamodel.html#object.__new__>.

Try:

    object.__init__(self[, …])
        Called automatically after the constructor “__new__”, during
        instance creation, to initialise the new instance.

-- 
 \      “Software patents provide one more means of controlling access |
  `\      to information. They are the tool of choice for the internet |
_o__)                                     highwayman.” —Anthony Taylor |
Ben Finney

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


Thread

Re: __init__ is the initialiser Ben Finney <ben+python@benfinney.id.au> - 2014-02-01 13:10 +1100

csiph-web