Python Sanity Proposal: Type Hinting Solution

Chris Angelico rosuav at gmail.com
Thu Jan 22 22:59:00 EST 2015


On Fri, Jan 23, 2015 at 2:22 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> This idea is so brilliant that it is already an option in mypy and is part
> of the new type-hint proposal.  The separate type-hint files are called
> 'stub files'.

It's worth pointing out, too, that the idea isn't panaceaic - it's
just another tool in the box. Any time you break related things into
separate places, especially separate files, the tendency for them to
get out of sync grows dramatically. Use of stub files for something
that's only occasionally run (the type-checking linter) increases the
potential time delay between the error and the fix. Unless you make a
git/hg hook that runs type checks, chances are you'll have those
issues in your code.

Stub files are useful, but they aren't going to magically solve
everyone's complaints.

ChrisA



More information about the Python-list mailing list