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

Paul Sokolovsky pmiscml at gmail.com
Tue Apr 21 20:31:49 CEST 2015


Hello,

On Tue, 21 Apr 2015 09:50:59 -0700
Ethan Furman <ethan at stoneleaf.us> wrote:

> On 04/21, Paul Sokolovsky wrote:
> > 
> > And for example yesterday's big theme was people blackmailing that
> > they stop contributing to stdlib if annotations are in [...]
> 
> A volunteer's honest reaction is not blackmail, and categorizing it
> as such is not helpful to the discussion.

Sure, that was rather humoresque note. Still, one may wonder why
"honest reaction" is like that, if from reading PEP484 it's clear that
it doesn't change status quo: https://www.python.org/dev/peps/pep-3107
added annotations long ago, and PEP484 just provides default
semantics for them. Note that *default*, not the "only". PEP484 is full
of conditions and long transition windows. Did PEP3107 shutter
everyone's world? No. And PEP484 is nothing but a logical continuation
of PEP3107, coming forward with real use for annotations, but not
intended to shutter everyone's world.

Well, hopefully Guido now clarified what was already written PEP484 (or
not written, like nowhere it says "we add requirement of mandatory
typehints in version 3.x [of stdlib or otherwise]"). But now people try
to come up with *anti*-patterns on how to use type annotation and argue
that these anti-patterns are not useful. Surely, annotations are useful
in some places and not useful in other.

requests doesn't need them? Good. But it's quite useful to annotate FFT
routines and subroutines as taking arrays of floats, we can't get
"faster than C"(tm) without that, like some other languages did (or
claim to have done, and now look attractive). (You don't do FFT in
Python? OMG, that's old.)


-- 
Best regards,
 Paul                          mailto:pmiscml at gmail.com


More information about the Python-Dev mailing list