summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@dropbox.com>2016-06-28 17:12:22 (GMT)
committerGuido van Rossum <guido@dropbox.com>2016-06-28 17:12:22 (GMT)
commit7acc3486d64c7625d9a366c5834028aa81ae162c (patch)
treefed372609e4a4b624335b01b0209c2b25dab4a6c
parent5eef78b1131bb720f7384b29ae99f0285d2d7fa8 (diff)
parent457509826ec0ed9c593c46d122e910f5cae36e58 (diff)
downloadcpython-7acc3486d64c7625d9a366c5834028aa81ae162c.zip
cpython-7acc3486d64c7625d9a366c5834028aa81ae162c.tar.gz
cpython-7acc3486d64c7625d9a366c5834028aa81ae162c.tar.bz2
Fix issue #27402: example for typing did not type-check. (Merge 3.5->3.6)
-rw-r--r--Doc/library/typing.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 3e9a006..9fa543c 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -427,8 +427,8 @@ The module defines the following classes, functions and decorators:
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])