Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65146 > unrolled thread
| Started by | Cameron Simpson <cs@zip.com.au> |
|---|---|
| First post | 2014-02-01 09:45 +1100 |
| Last post | 2014-02-01 09:45 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: __init__ is the initialiser Cameron Simpson <cs@zip.com.au> - 2014-02-01 09:45 +1100
| From | Cameron Simpson <cs@zip.com.au> |
|---|---|
| Date | 2014-02-01 09:45 +1100 |
| Subject | Re: __init__ is the initialiser |
| Message-ID | <mailman.6226.1391208314.18130.python-list@python.org> |
On 31Jan2014 12:57, Ethan Furman <ethan@stoneleaf.us> wrote:
> On 01/31/2014 12:48 PM, MRAB wrote:
> >On 2014-01-31 19:52, Ned Batchelder wrote:
> >>Why can't we call __init__ the constructor and __new__ the allocator?
> >
> >The advantage of calling it the "initialiser" is that it explains why
> >it's called "__init__".
>
> Hm, yes, good point. Also, __init__ initializes so it is a good choice. Ignore the names comment in my previous post.
On this basis, would it suffice to change the opening sentence from:
Called when the instance is created.
to
Called to initialise a new instance immediately after creation.
?
This seems succinct while getting both "initialise" and "new" into
the line, which makes it clear that there is a separate and earlier
"new" step. (Conveniently overridable with __new__ :-)
Cheers,
--
Cameron Simpson <cs@zip.com.au>
Don't have awk? Use this simple sh emulation:
#!/bin/sh
echo 'Awk bailing out!' >&2
exit 2
- Tom Horsley <tahorsley@csd.harris.com>
Back to top | Article view | comp.lang.python
csiph-web