Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Life sucks, but it's better than the alternative." -- Peter da Silva


devel / comp.lang.python / Re: Why doc call `__init__` as a method rather than function?

SubjectAuthor
o Re: Why doc call `__init__` as a method rather than function?Roel Schroeven

1
Re: Why doc call `__init__` as a method rather than function?

<mailman.327.1695025157.23016.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=28437&group=comp.lang.python#28437

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news-2.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: roel@roelschroeven.net (Roel Schroeven)
Newsgroups: comp.lang.python
Subject: Re: Why doc call `__init__` as a method rather than function?
Date: Mon, 18 Sep 2023 10:19:12 +0200
Lines: 21
Message-ID: <mailman.327.1695025157.23016.python-list@python.org>
References: <OS3P286MB0740BDD307B9BEB732BD2256A5F6A@OS3P286MB0740.JPNP286.PROD.OUTLOOK.COM>
<6a907429.54af.18a98f21d8d.Webtop.90@btinternet.com>
<fb6b5ac0-bb63-4aca-a8ef-c3eca2097058@roelschroeven.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 3qS9jPW/nuEaFVyIkxF1lASYZtOAQgENNJe7y23U1F4A==
Cancel-Lock: sha1:xLmhkwa2B9qEqWa9ipcXn+2hQeY= sha256:x9/al8JuSjF3B/RDygooZRzLrSE/1SDOMXQrPAeicOI=
Return-Path: <roel@roelschroeven.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=roelschroeven.net header.i=@roelschroeven.net
header.b=dtrzOJy5; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.182
X-Spam-Level: *
X-Spam-Evidence: '*H*': 0.73; '*S*': 0.10; 'subject:Why': 0.07;
'derived': 0.09; "shouldn't": 0.09; 'subject:doc': 0.09;
'instance': 0.16; 'received:10.202': 0.16; 'received:10.202.2':
0.16; 'received:internal': 0.16; 'received:messagingengine.com':
0.16; 'schreef': 0.16; 'subject:call': 0.16; 'to:addr:python-
list': 0.20; 'header:User-Agent:1': 0.30; 'there': 0.33; 'header
:In-Reply-To:1': 0.34; 'received:66': 0.35; 'functions': 0.36;
'way': 0.38; 'methods': 0.39; 'base': 0.40; 'learn': 0.40;
'method': 0.61; 'ever': 0.63; 'experience': 0.64; 'others,': 0.64;
'subject:method': 0.69; 'ability': 0.71; 'features': 0.75; '____':
0.84; 'apparent': 0.84; 'obj': 0.84; 'adams': 0.91;
'subject:than': 0.91; 'newly': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
roelschroeven.net; h=cc:content-transfer-encoding:content-type
:content-type:date:date:from:from:in-reply-to:in-reply-to
:message-id:mime-version:references:reply-to:sender:subject
:subject:to:to; s=fm1; t=1695025154; x=1695111554; bh=MRnWaZwoh9
IAgmTBGQJeSjtqA95LsJwZuZknuWHNs4s=; b=dtrzOJy5yojCLcI4xw3yecDbbE
nCCFfUeh/7AOdbio+IgWSZwNuhM36rokneNNty1TRTD9K+z/J8HP767zbWU+6Jkb
Upu9dzi60h5NO/zjgqT0KvEGRIizZgd4Qc0jxdpAPniNaTgGZE1Zn7+StGOlzGUx
2YiIifQQOcuG1SLuyEj78FlftWYMITtVuX3h6Gw8JJ+CMI3VyxZVb5Gw6FVa3fCB
/6fYv2y83Lmu2aEPUDcsR1aR29xFGhqwi50B54iZHh+H36NKHKyTAivj7TXTHLG3
IcfydsmipVr74442FPAeNjSz0j3Ib5gZ17ofEWsOo2VXsxzlto962zVHFsSQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
messagingengine.com; h=cc:content-transfer-encoding:content-type
:content-type:date:date:feedback-id:feedback-id:from:from
:in-reply-to:in-reply-to:message-id:mime-version:references
:reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy
:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1695025154; x=
1695111554; bh=MRnWaZwoh9IAgmTBGQJeSjtqA95LsJwZuZknuWHNs4s=; b=X
CkmhASASbS69xRpagDChsTf1gTFvkHGtH/DSPZrdAaquKQ9y4CG1dCvtmreql8X2
DxkRi0URL6D9okclKq616uI17Cb8rjeIlKi0CKsVedtLJE/T8XvE0ikvCT/u3s0N
v1KOIjdSsn7pRDkAQxOxEu0d0k6deHZeh4uVn1BItuOCkopooexviPrqNtYnhryh
9XF3Tl4NljNCZeW1ftlaKS/LErbZfRgGgxMBJKTjkhWw6POtOW0kQ5TRzTyajo8h
iCspd9Id4szMrVxhvGKQ77FS9gpoSSCaJOc1cyiKVSyQKj2MPuaDmGZ+Fwn1r66c
K86iDp7CVLwmqAZLpfu/w==
X-ME-Sender: <xms:AggIZRPaaxczTiyRBILzlhsuYFucLZXSJ6oHQA6E2Bel6m7WxNq28g>
<xme:AggIZT8IU6pgB13wtFrRftpAPZ9hv2Czf3s7xv3UHALhIbieeLa3yqJu6GC6LYhdc
UItn-NrGK19>
X-ME-Received: <xmr:AggIZQR1N1K4hPEvejUqhdRFX2vOchUGTF_Io42QIj41NKgIotv_kqZjOujILxJp891XA_8_unj5nos17SCAtgBqRImcsK5_S-67AlhGSopic8U>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejkedgtddvucetufdoteggodetrfdotf
fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke
ertddtvdejnecuhfhrohhmpeftohgvlhcuufgthhhrohgvvhgvnhcuoehrohgvlhesrhho
vghlshgthhhrohgvvhgvnhdrnhgvtheqnecuggftrfgrthhtvghrnhepgeejffekgedvve
ejjefhgedtvdehhfeihfelfefhgfeitddvieegieeigedvudfhnecuvehluhhsthgvrhfu
ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhhovghlsehrohgvlhhstghhrh
hovghvvghnrdhnvght
X-ME-Proxy: <xmx:AggIZdvWUXEqTE53UdL7s-tjlFa2KGr5xqOztKM9Q2qIvojbPU-JYA>
<xmx:AggIZZcBCf9WUnt4LIZHVFIb0G7KwnkQscs9n88CxrY-H5d7DrE1aw>
<xmx:AggIZZ3zXZgty00smgpeztJqz89P2xzebgwW-Nhk-VP16Gtzaythpw>
<xmx:AggIZfpjskiwuLXU2WVBBIICVtkZIoLsyKO0h7LQFK3C4yJHlsLPrw>
Feedback-ID: i8e5b41ae:Fastmail
User-Agent: Mozilla Thunderbird
Content-Language: nl, en-US
In-Reply-To: <6a907429.54af.18a98f21d8d.Webtop.90@btinternet.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
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: <https://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>
X-Mailman-Original-Message-ID: <fb6b5ac0-bb63-4aca-a8ef-c3eca2097058@roelschroeven.net>
X-Mailman-Original-References: <OS3P286MB0740BDD307B9BEB732BD2256A5F6A@OS3P286MB0740.JPNP286.PROD.OUTLOOK.COM>
<6a907429.54af.18a98f21d8d.Webtop.90@btinternet.com>
 by: Roel Schroeven - Mon, 18 Sep 2023 08:19 UTC

Op 15/09/2023 om 15:05 schreef anthony.flury via Python-list:
> Like all of the other __<name>__ methods you shouldn't ever need to
> call them directly : these are called dunder methods and represent
> functions and features which are called by other operators.
>
> The only recommended way to call A.__init__ is to create an instance
> of A : obj = A() - the __init__ method gets called automatically with
> a newly created object.
There is an exception:

  super().__init__()

to call the base class's __init__ (normally from the derived class's
__init__)

--
"Human beings, who are almost unique in having the ability to learn from the
experience of others, are also remarkable for their apparent disinclination
to do so."
-- Douglas Adams


devel / comp.lang.python / Re: Why doc call `__init__` as a method rather than function?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor