[Python-Dev] Type hints -- a mediocre programmer's reaction

Ben Finney ben+python at benfinney.id.au
Tue Apr 21 02:52:52 CEST 2015


Chris Angelico <rosuav at gmail.com> writes:

> On Tue, Apr 21, 2015 at 9:41 AM, Jack Diederich <jackdied at gmail.com> wrote:
> > * It is not optional. Please stop saying that. The people promoting
> > it would prefer that everyone use it. If it is approved it will be
> > optional in the way that PEP8 is optional. If I'm reading your
> > annotated code it is certainly /not/ optional that I understand the
> > annotations.
[…]
>
> Maybe I'm completely misreading everything here […]

I think you've misunderstood the complaint.

> When you're writing a library, it can be a great help to provide type
> annotations, because every application that uses your library can
> benefit. When you're writing an application, you can completely ignore
> them, but still get the benefit of everyone else's.

Jack is not complaining only about *writing* code. He's complaining
about the effect this will have on code that we all are expected to
*read*.

Programmers spend a great deal of time reading code written by other
people. The costs of this proposal are only partly on the writers of the
code; they are significantly borne by the people *reading* that code.
For them, it is not optional.

> I have no fears for my own code. Are you afraid for yours?

Jack, if I understand correctly, fears for the code that will be written
by others in conformance with this proposal, that he will then have to
read and understand.

-- 
 \      “The opposite of a correct statement is a false statement. But |
  `\     the opposite of a profound truth may well be another profound |
_o__)                                              truth.” —Niels Bohr |
Ben Finney



More information about the Python-Dev mailing list