__init__ is the initialiser

Ben Finney ben+python at benfinney.id.au
Sun Feb 2 05:27:36 CET 2014


Ned Batchelder <ned at nedbatchelder.com> writes:

> My summary of our two views is this: I am trying to look at things
> from a typical programmer's point of view.

Do you think the typical programmer will be looking in the language
reference? I don't.

> The existence of __new__ is an advanced topic that many programmers
> never encounter.

But when they do, the language reference had better be very clear on the
purpose of “__init__” and “__new__”.

> You are looking at things from an accurate-down-to-the-last-footnote
> detailed point of view (and have provided some footnotes!). That's a
> very valuable and important point of view. It's just not how most
> programmers approach the language.

Won't most programmers approach the language through (a) some example
code, (b) the tutorial, (c) the library reference? Those are appropriate
places for helpful simplifications and elisions.

> We are also both trying to reduce cognitive dissonance, but again, you
> are addressing language mavens who understand the footnotes, and I am
> trying to help the in-the-trenches people who have never encountered
> __new__ and are wondering why people are using funny words for the
> code they are writing.

Then I think your attempt to sacrifice precise terminology in the
langauge reference is misplaced. The in-the-trenches people won't see
it; and, when they go looking for it, they're likely to be wanting exact
language-maven-directed specifications.

> Finding names for things is hard, and it's impossible to please both
> ends of this spectrum.

Very true. That's why we have different documents for different
audiences. But yes, the terminology needs to hold up for both ends of
the spectrum, and naming is difficult.

-- 
 \         “If nature has made any one thing less susceptible than all |
  `\    others of exclusive property, it is the action of the thinking |
_o__)                          power called an idea” —Thomas Jefferson |
Ben Finney




More information about the Python-list mailing list