From: Guido van Rossum Date: Sun, 9 Oct 2016 03:12:54 +0000 (-0700) Subject: Adjust ClassVar example to use pre-PEP-526 syntax. (Issue #28388) X-Git-Tag: v3.6.0b2~16^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b2aa2e87c524f165f7664fbe473d0be10af8c7a;p=python Adjust ClassVar example to use pre-PEP-526 syntax. (Issue #28388) --- diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 8b4eec3eab..898a0f01e1 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.