]> granicus.if.org Git - python/commitdiff
#14187: Add glossary entry for 'function annotations'.
authorR David Murray <rdmurray@bitdance.com>
Mon, 6 May 2013 16:58:16 +0000 (12:58 -0400)
committerR David Murray <rdmurray@bitdance.com>
Mon, 6 May 2013 16:58:16 +0000 (12:58 -0400)
Patch by Chris Rebert.

Doc/glossary.rst

index f30138adbc101a92192af9576c1f28af334d5376..63f1021afcbbaa43bf94642f4fab2d38711334f6 100644 (file)
@@ -252,6 +252,16 @@ Glossary
       the execution of the body. See also :term:`parameter`, :term:`method`,
       and the :ref:`function` section.
 
+   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.
+
    __future__
       A pseudo-module which programmers can use to enable new language features
       which are not compatible with the current interpreter.