[Python-ideas] Optional Static Typing -- the Python Way

Terry Reedy tjreedy at udel.edu
Wed Aug 20 00:50:13 CEST 2014


On 8/19/2014 9:27 AM, Nick Coghlan wrote:

What I like: 'optional type hints' based on a fleshed-out ABC systems 
that collects all ABCs together on one module via import from current 
files. It seems that we have been slowly groping towards this for years.

What I also like: shadow skeleton files (for the stdlib) written by 
people other than core developers, who obviously have the energy to do 
so, having already started with various syntaxes, and who just need a 
standard to combine their efforts.  There should be one set that, as 
much as possible, fully allows duck-typing, which is to say, does not 
reject valid arguments.

What I want to add: the advantage of separate skeleton files, aside from 
parallel development by other people, is that there can be more than one 
skeleton file for a given stdlib module.  Linters typically allow users 
to set local standards by selecting options.  A group could also set 
local standards by restrictive type hints in their local skeletons. A 
realistic example would be sum(it: Iterable[Number]).

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list