(1) A change of direction for function annotations
PEP 3107, which introduced function annotations, is intentional non-committal about how function annotations should be used. It lists a number of use cases, including but not limited to type checking. It also mentions some rejected proposals that would have standardized either a syntax for indicating types and/or a way for multiple frameworks to attach different annotations to the same function. AFAIK in practice there is
On Aug 13, 2014 9:45 PM, "Guido van Rossum"
(We may have to have some backwards compatibility provision to avoid
breaking code that currently uses annotations for some other purpose. Fortunately the only issue, at least initially, will be that when running mypy to type check such code it will produce complaints about the annotations; it will not affect how such code is executed by the Python interpreter. Nevertheless, it would be good to deprecate such alternative uses of annotations.) I watched the original talk and read your proposal. I think type annotations could very very useful in certain contexts. However, I still don't get this bit. Why would allowing type annotations automatically imply that no other annotations would be possible? Couldn't we formalize what would be considered a type annotation while still allowing annotations that don't fit this criteria to be used for other things?