[Python-checkins] cpython (3.5): Adjust ClassVar example to use pre-PEP-526 syntax. (Issue #28388)
guido.van.rossum
python-checkins at python.org
Sat Oct 8 23:14:10 EDT 2016
https://hg.python.org/cpython/rev/d7f2b0332343
changeset: 104400:d7f2b0332343
branch: 3.5
parent: 104397:9953efbb4974
user: Guido van Rossum <guido at python.org>
date: Sat Oct 08 20:12:54 2016 -0700
summary:
Adjust ClassVar example to use pre-PEP-526 syntax. (Issue #28388)
files:
Doc/library/typing.rst | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -845,8 +845,8 @@
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.
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list