diff -r 4e9680570be8 Doc/glossary.rst --- a/Doc/glossary.rst Thu May 10 18:11:30 2012 -0700 +++ b/Doc/glossary.rst Fri May 11 14:47:45 2012 -0700 @@ -225,6 +225,20 @@ be passed zero or more arguments which may be used in the execution of the body. See also :term:`argument` and :term:`method`. + function annotation + An arbitrary metadata value associated with a function parameter or return + value. Its syntax is explained in section :ref:`function`. Annotations + may be accessed via the :attr:`__annotations__` special attribute of a + function object. + + Python itself does not assign any particular meaning to function + annotations. They are intended to be interpreted by third-party libraries + or tools. See :pep:`3107`, which describes some of their potential uses. + + Some other languages (such as Java) also have a concept of "annotations", + but it is distinct from the Python concept. In Python, the purpose of + such "annotations" is served by :term:`decorators ` instead. + __future__ A pseudo-module which programmers can use to enable new language features which are not compatible with the current interpreter.