[Python-ideas] PEP 484 evolution

Terry Reedy tjreedy at udel.edu
Sat Mar 19 18:42:36 EDT 2016


On 3/19/2016 4:14 PM, Rick Johnson wrote:

> You, and a few others supporters, keep claiming that "type-
> hints" are optional -- but while they may be optional to
> *write*, they are *not* optional to *read*.

Just to be sure you know, one of the options is to put type-hints in a 
separate stub file, so only those concerned will ever see them.  In 
particular, type hints for the stdlib will have to be kept separate.

>      def greeting(names: Union[List[str], Dict[int, List[str]]]) -> Union[
>              List[str], Dict[int, List[str]]]:

I agree that the extra overloading makes this hard to read by obscuring 
the essential parts.  Anything like the above should be in private code 
or stub files.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list