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

Skip Montanaro skip at pobox.com
Fri Aug 22 15:42:00 CEST 2014


There's been a lot to read in this and related threads over the past nine
days. (According to Gmail. It qualitatively seems much longer to me.) I
think I've followed along reasonably well. Forgive me if I missed the
answers to these questions. The proposal on the table is to adopt MyPy's
type annotations for Python 3.mumble. I presume MyPy already supports them.

1. Can MyPy be used today as a standalone static type checker for Python
3.x code without actually compiling anything? That is, can I just sprinkle
type annotations into my code and run a front-end pass of MyPy much the
same way I'd run pylint, vulture, flake8, or other lint-ish program?

2. Assuming the answer to #1 is "yes," if you start sprinkling type
annotations into your code and running "mypy *.py", will it tell you when
it needs a missing type annotation to more fully check things, or will it
silently process code without annotations and not let you know that it's
not really checking much?

3. Will we get into a phase like the early days of "const" in ANSI C where
addition of "const" in one location in your existing code base forced you
into a never-ending iterations of adding const all over the place? I forget
what that was called ("const propagation"?), but I recall that it generally
wasn't a fun activity.

4. If the answer to #1 is "no," are there plans to produce a front-end-only
MyPy which can be used as a linter for Python code?

Thx,

Skip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140822/1009e6c5/attachment.html>


More information about the Python-ideas mailing list