[Python-3000] Draft pre-PEP: function annotations
collinw at gmail.com
Sat Aug 12 04:43:43 CEST 2006
On 8/11/06, Talin <talin at acm.org> wrote:
> The story also has to do with people who assume things about the
> behavior of other software developers - specifically, my assumption that
> other people, working in isolation from one another, would come up with
> the same or similar solutions to a given problem, vs. Colin's assumption
> that other creators of annotation interpreters would coordinate their
> efforts in a sensible way.
I make no assumptions that people writing annotation interpreters will
coordinate their efforts. My assertion that "[t]here is no worry that
these libraries will assign semantics at random, or that a variety of
libraries will appear, each with varying semantics and interpretations
of what, say, a tuple of strings means." is not based on coordination
but rather the marketplace. If someone starts assigning semantics that
aren't "pythonic", that don't fit in with how the majority of Python
programmers think, no-one will use their library and it will die.
The drive to write, release and maintain open-source software is
predicated on a desire to have people use your product, to find it
useful. To that end, I expect that the creators of annotation
interpreters will take care to maximise the utility (and hence the
audience) for their library.
> What the annotation PEP and the SysEx have in common is that they are
> both dealing with an open-ended specification - one which allows any
> provider to extend the protocol in any way they wish, without any
> knowledge or coordination from any other provider.
In your long parable, you've ignored the key difference between the
open-ended-ness of my PEP and that of SysEx: there are much greater
environmental constraints on people writing interpreters for function
annotations. The only constraints for developers using SysEx are
"anything you can turn into bytes".
> Another lesson of the story has to do with the failure of the MMA
> committee to specify any guidelines or hints as to how their open-ended
> protocol should be used.
I agree that the PEP needs to include some guidance for those writing
annotation interpreters (such as how to anticipate being used in
conjunction with other interpreters), but I see no merit in setting in
stone a list of officially endorsed uses for function annotations.
> In other words, I criticize both the MMA's spec and Colin's for the sin
> of underspecification - that is, allowing critical decisions that
> *should* have been made by the standard writer to instead be made by the
> standard implementers, with the result that each implementer comes up
> with their own unique solution to a problem which should have been
> solved in the original standard doc.
Are you referring to the fact that the PEP doesn't dictate how lists,
tuples, etc are to be interpreted, or still to the fact that I didn't
include a paragraph talking about interpreter chaining?
> -- Talin
PS: My name has 2 L's in it.
More information about the Python-3000