[Python-3000] Draft pre-PEP: function annotations
Phillip J. Eby
pje at telecommunity.com
Tue Aug 15 18:05:22 CEST 2006
At 07:04 AM 8/15/2006 -0700, Paul Prescod wrote:
>On 8/14/06, Guido van Rossum <<mailto:guido at python.org>guido at python.org>
>>Haven't I said that the whole time? I *thought* that Collin's PEP
>>steered clear from the topic too. At the same time, does this preclude
>>having some kind of "default" type notation in the standard library?
>The PEP steered TOO far of this topic. If it is total free-for-all then
>when and if we do come up with a standard syntax (whether in 2006 or 2010)
>it will conflict with deployed code that used the same syntax to mean
>something different then the standard. And even if there is never, ever,
>going to be a standard, it must be possible for tools reading the
>annotations to know whether the user intended their markup to conform to
>metadata-syntax 1, where "int" means "32 bit int" or metadata syntax 2
>where it means "arbitrary sized int". Similarly, they must know whether
>the annotater intended to use metadata syntax 1 where "tuple" means "fixed
>size, heterogenous" or syntax 2 where it means "immutable list".
On the contrary - it is precisely this looseness that the PEP meant to
specify, and that I support. The alternative is too restrictive.
Meanwhile, the absence of predefined semantics does *not* preclude a
default type notation existing in the standard library, any more than the
absence of a predefined semantics for docstrings or function attributes
prevents the stdlib from containing docstring processors or tools that
operate on function attributes.
More information about the Python-3000