[Python-3000] Draft pre-PEP: function annotations
paul at prescod.net
Tue Aug 15 16:04:19 CEST 2006
On 8/14/06, Guido van Rossum <guido at python.org> wrote:
> 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".
Finally, there must be a standard way for attaching more than one annotation
to a single parameter. The PEP did not define a syntax for that.
I think that there must be enough standardized infrastructure that
annotation processors can recognize the annotations that are applicable to
them and act on them, even if the user has chosen to use more than one
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-3000