diff options
author | Guido van Rossum <guido@dropbox.com> | 2016-09-11 16:45:24 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@dropbox.com> | 2016-09-11 16:45:24 (GMT) |
commit | 015d8746261f23084d449ae9f382d7088ec7016f (patch) | |
tree | 54a689b42bfa979d7975f3006951d795a891b509 /Doc | |
parent | a6d75fdc37e4cbc49fe64420219f3b4da1b20cef (diff) | |
download | cpython-015d8746261f23084d449ae9f382d7088ec7016f.zip cpython-015d8746261f23084d449ae9f382d7088ec7016f.tar.gz cpython-015d8746261f23084d449ae9f382d7088ec7016f.tar.bz2 |
Issue #28076: Variable annotations should be mangled for private names.
By Ivan Levkivskyi.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/reference/simple_stmts.rst | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 6aafa72..3dc4418 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -334,9 +334,10 @@ only single right hand side value is allowed. For simple names as assignment targets, if in class or module scope, the annotations are evaluated and stored in a special class or module attribute :attr:`__annotations__` -that is a dictionary mapping from variable names to evaluated annotations. -This attribute is writable and is automatically created at the start -of class or module body execution, if annotations are found statically. +that is a dictionary mapping from variable names (mangled if private) to +evaluated annotations. This attribute is writable and is automatically +created at the start of class or module body execution, if annotations +are found statically. For expressions as assignment targets, the annotations are evaluated if in class or module scope, but not stored. |