Message155423
Strawman entry wording:
An annotation is an arbitrary metadata value associated with a function parameter or return value. The syntax for function annotations is explained in [Function definitions][http://docs.python.org/dev/reference/compound_stmts.html#function-definitions]. Annotations may be accessed via the [__annotations__][http://docs.python.org/dev/reference/datamodel.html#the-standard-type-hierarchy : Callable types -> User-defined functions -> Special attributes] 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. Annotations were added to Python by [PEP 3107 "Function Annotations"][http://www.python.org/dev/peps/pep-3107/], which describes some of their possible uses.
Some other languages (e.g. Java, C#) also have a concept of "annotations", but it is distinct from the Python concept; the purpose of these "annotations" is served in Python using [decorators]["decorator" entry in Glossary] instead. |
|
Date |
User |
Action |
Args |
2012-03-12 00:14:32 | cvrebert | set | recipients:
+ cvrebert, rhettinger, ezio.melotti, eric.araujo, docs@python |
2012-03-12 00:14:32 | cvrebert | set | messageid: <1331511272.21.0.909972779247.issue14187@psf.upfronthosting.co.za> |
2012-03-12 00:14:31 | cvrebert | link | issue14187 messages |
2012-03-12 00:14:31 | cvrebert | create | |
|