
On 11/26/21 1:13 AM, Paul Moore wrote:
On Fri, 26 Nov 2021 at 05:14, Guido van Rossum wrote:
My memory is also hazy, but I'm quite sure that *in my mind* annotations were intended as a compromise between conflicting proposals for *typing*. We didn't have agreement on the syntax or semantics, but we did know we wanted to do something with types eventually.
More hazy memories here, but I think the original proposal left open the possibility of annotations not being types at all - for example, being docstrings for the arguments, or option names for a "function call to CLI" tool, etc. I think that some libraries took this approach (in particular the "CLI builder" idea).
I have one such tool. Fortunately for me, I strongly dislike having the annotations inside the function header as it quickly gets difficult for me to read, so I was already using decorator syntax for the annotations. When PEP 484 was accepted I just changed where the annotations were being stored from __annotations__ to my own dunder. -- ~Ethan~