[issue32769] Add 'annotations' to the glossary

Łukasz Langa report at bugs.python.org
Tue May 15 15:30:03 EDT 2018


Łukasz Langa <lukasz at langa.pl> added the comment:

> It may be deprecated but the usage still exists. This is a glossary, not a manifesto.

Agreed.  However, based on the current wording users will argue that Python documentation itself is stressing the lack of an intended purpose for annotations, equaling the typing use case with all other use cases (including future ones).  This isn't our intent.

I think it would be clearer to change the current wording from:

> A metadata value associated with a variable, a class attribute or a
> function or method parameter or return value, that has no specific
> purpouse (i.e. it's up to the user to use it as they see fit).
> (...)
> Annotations can be used to specify :term:`type hints <type hint>`.

to:

> A metadata value associated with a variable, a class attribute or a
> function or method parameter or return value, that stores a
> :term:`type hint`.
> (...)
> Annotations can be used for other purposes unrelated to typing. This
> usage is deprecated, see :pep:`563` for details.


The `type hint` phrasing is already there, we just need to delete the word "global" that currently appears before "variable".  Note that saying that annotations in class attributes and variables have no assigned meaning contradicts PEP 526.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32769>
_______________________________________


More information about the Python-bugs-list mailing list