]> granicus.if.org Git - python/commitdiff
Adjust ClassVar example to use pre-PEP-526 syntax. (Issue #28388)
authorGuido van Rossum <guido@python.org>
Sun, 9 Oct 2016 03:12:54 +0000 (20:12 -0700)
committerGuido van Rossum <guido@python.org>
Sun, 9 Oct 2016 03:12:54 +0000 (20:12 -0700)
Doc/library/typing.rst

index 8b4eec3eab5425131d36706d08a9228894ec8fa9..898a0f01e1d9b4bc5af0c06b8ed74be616a31259 100644 (file)
@@ -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.