[Python-ideas] Conventions for function annotations

Ned Batchelder ned at nedbatchelder.com
Tue Dec 4 18:12:12 CET 2012


On 12/4/2012 11:43 AM, Jasper St. Pierre wrote:
> Indeed. I've looked at annotations before, but I never understood the 
> purpose. It seemed like a feature that was designed and implemented 
> without some goal in mind, and where the community was supposed to 
> discover the goal themselves.
>
> So, if I may ask, what was the original goal of annotations? The PEP 
> gives some suggestions, but doesn't leave anything concrete. Was it 
> designed to be an aid to IDEs, or static analysis tools that inspect 
> source code? Something for applications themselves to munge through to 
> provide special behaviors, like a command line parser, or runtime 
> static checker?

A telling moment for me was during an early Py3k keynote at PyCon 
(perhaps it was in Dallas or Chicago?), Guido couldn't remember the word 
"annotation," and said, "you know, those things that aren't type 
declarations?"  :-)

--Ned.



More information about the Python-ideas mailing list