[Python-ideas] Proposal: Use mypy syntax for function annotations

Petr Viktorin encukou at gmail.com
Thu Aug 14 16:52:33 CEST 2014


It seems to me that rather than adding a module which is only used by
one project so far to the standard library is a bit premature.

I support optional typing, but why push this to stdlib now? Wouldn't
it be better to wait until most IDEs/linters all agree on this syntax,
until freezing it in stdlib? So far typing seems to be a part of mypy,
shouldn't it spend some time on PyPI first?

I'm also sure about there not being other uses of annotations -- clize
aside, there are not many widely used Python3-only 3rd party
libraries, so it's no surprise that nothing big is built around Python
3 features.

Maybe the way from PEP 3107's "here's a feature, use it for whatever
you like" to "annotations are for typing declarations, using
mypy/typing syntax" should include a step of "if you use annotations
for typing, use mypy/typing syntax for it". (And perhaps it should end
there.)


More information about the Python-ideas mailing list