[Python-ideas] Proposal: Use mypy syntax for function annotations
Antoine Pitrou
antoine at python.org
Mon Aug 25 04:51:15 CEST 2014
Le 24/08/2014 22:30, Guido van Rossum a écrit :
>
> People who are talking about what should happen if a decorator changes
> __annotations__ are likewise missing the point.
But you shouldn't use annotations for something that refuses to use
runtime introspection abilities. There's no reason to waste annotations
if the need can be fullfilled by separate description files in a DSL
that doesn't even need to be Python code (but cutely looks like so).
And it's not surprising that some people may be missing the point when a
feature pretends to use a runtime facility but interprets it from a
separate channel which eschews any code execution.
Your proposal seems determined by the fact that mypy has much grander
ambitions (and therefore requires its insertion into regular Python),
but it doesn't make use of that power at all, worse, it forbids others
to use it.
Regards
Antoine.
More information about the Python-ideas
mailing list