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

Terry Reedy tjreedy at udel.edu
Mon Aug 25 08:18:12 CEST 2014


On 8/24/2014 11:12 PM, Guido van Rossum wrote:

> Finally, I would actually be okay if we found a way to let type hints
> and other annotations coexist -- I just prefer type hints to be the
> default use, since I see them as much more generally useful than all
> other uses combined.

I believe co-existence is possible, but the details will depend on the 
form type hints take. First, other annotations should be easily 
distinguished from type hints. Second, other annotations that would 
interfere with the runtime use of __annotations__ should be pulled out 
by a decorator and possibly moved to another attribute specific to the 
decorator (such as '_deco_name').

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list