diff --git a/pep-0526.txt b/pep-0526.txt index 12413a793..e0f51b231 100644 --- a/pep-0526.txt +++ b/pep-0526.txt @@ -384,16 +384,19 @@ evaluated:: In addition, at the module or class level, if the item being annotated is a *simple name*, then it and the annotation will be stored in the -``__annotations__`` attribute of that module or class as a dictionary mapping -from names to evaluated annotations. Here is an example:: +``__annotations__`` attribute of that module or class (mangled if private) +as a dictionary mapping from names to evaluated annotations. +Here is an example:: from typing import Dict class Player: ... players: Dict[str, Player] + __points: int print(__annotations__) - # prints: {'players': typing.Dict[str, __main__.Player]} + # prints: {'players': typing.Dict[str, __main__.Player], + # '_Player__points': } ``__annotations__`` is writable, so this is permitted::