[Python-Dev] Is static typing still optional?

Paul Moore p.f.moore at gmail.com
Tue Dec 19 05:53:20 EST 2017


On 19 December 2017 at 07:49, Eric V. Smith <eric at trueblade.com> wrote:
> Data Classes is also not the first use of type annotations in the stdlib:
> https://docs.python.org/3/library/typing.html#typing.NamedTuple
>

Also, the fact that no-one raised this issue during the whole time the
PEP was being discussed (at least as far as I recollect) and that
Guido (who of all of us should be most aware of what is and isn't
acceptable use of annotations in the stdlib) approved the PEP,
suggests to me that this isn't that big a deal.

The only thing that has surprised me in this discussion is that the
actual type used in the annotation makes no difference. And once
someone reminded me that types are never enforced at runtime (you can
call f(x: int) with f('haha')) that seemed fine.

Paul


More information about the Python-Dev mailing list