Commit 7b2aa2e8 authored by Guido van Rossum's avatar Guido van Rossum

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

parent deed0c79
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment