summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2016-10-09 03:12:54 (GMT)
committerGuido van Rossum <guido@python.org>2016-10-09 03:12:54 (GMT)
commit7b2aa2e87c524f165f7664fbe473d0be10af8c7a (patch)
tree508eaa36f6ff5b7346609db4b5fe6f5ec9f1d5e1 /Doc
parentdeed0c797ceb9e0cb2e8e9089ac717cbd2f7f9a8 (diff)
downloadcpython-7b2aa2e87c524f165f7664fbe473d0be10af8c7a.zip
cpython-7b2aa2e87c524f165f7664fbe473d0be10af8c7a.tar.gz
cpython-7b2aa2e87c524f165f7664fbe473d0be10af8c7a.tar.bz2
Adjust ClassVar example to use pre-PEP-526 syntax. (Issue #28388)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/typing.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 8b4eec3..898a0f0 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -845,8 +845,8 @@ The module defines the following classes, functions and decorators:
and should not be set on instances of that class. Usage::
class Starship:
- stats: ClassVar[Dict[str, int]] = {} # class variable
- damage: int = 10 # instance variable
+ stats = {} # type: ClassVar[Dict[str, int]] # class variable
+ damage = 10 # type: int # instance variable
:data:`ClassVar` accepts only types and cannot be further subscribed.