Python Sanity Proposal: Type Hinting Solution

Terry Reedy tjreedy at udel.edu
Fri Jan 23 00:03:26 EST 2015


On 1/22/2015 10:59 PM, Chris Angelico wrote:
> 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.

The same could be said of putting tests in a separate file.

 > 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.

Projects that view type-checks as tests that must pass will probably run 
them much more often.

-- 
Terry Jan Reedy




More information about the Python-list mailing list