[Python-checkins] cpython (3.5): Fix issue #27402: example for typing did not type-check.
guido.van.rossum
python-checkins at python.org
Tue Jun 28 13:13:11 EDT 2016
https://hg.python.org/cpython/rev/0aec17c8f434
changeset: 102224:0aec17c8f434
branch: 3.5
parent: 102222:e6525c6ad789
user: Guido van Rossum <guido at python.org>
date: Tue Jun 28 10:08:17 2016 -0700
summary:
Fix issue #27402: example for typing did not type-check.
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
@@ -428,8 +428,8 @@
def vec2(x: T, y: T) -> List[T]:
return [x, y]
- def slice__to_4(vector: Sequence[T]) -> List[T]:
- return vector[0:4]
+ def keep_positives(vector: Sequence[T]) -> List[T]:
+ return [item for item in vector if item > 0]
.. class:: Set(set, MutableSet[T])
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list