Adjust ClassVar example to use pre-PEP-526 syntax. (Issue #28388)

This commit is contained in:
Guido van Rossum 2016-10-08 20:12:54 -07:00
parent deed0c797c
commit 7b2aa2e87c
1 changed files with 2 additions and 2 deletions

View 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:: and should not be set on instances of that class. Usage::
class Starship: class Starship:
stats: ClassVar[Dict[str, int]] = {} # class variable stats = {} # type: ClassVar[Dict[str, int]] # class variable
damage: int = 10 # instance variable damage = 10 # type: int # instance variable
:data:`ClassVar` accepts only types and cannot be further subscribed. :data:`ClassVar` accepts only types and cannot be further subscribed.