summaryrefslogtreecommitdiff
path: root/Doc/library/typing.rst
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2016-06-28 10:08:17 -0700
committerGuido van Rossum <guido@python.org>2016-06-28 10:08:17 -0700
commitedab8dff3bdcfafb2a7210cc763477a964dcad28 (patch)
tree5dd5973bd0e9c8c46ebbab51c3fc80d6fdb5d08e /Doc/library/typing.rst
parent0f9508df1fb2ddbff68f4057d395a2b209aee170 (diff)
downloadcpython-edab8dff3bdcfafb2a7210cc763477a964dcad28.tar.gz
Fix issue #27402: example for typing did not type-check.
Diffstat (limited to 'Doc/library/typing.rst')
-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 731e2eca16..317229de0c 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -428,8 +428,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])