diff options
author | Guido van Rossum <guido@python.org> | 2016-06-28 17:08:17 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2016-06-28 17:08:17 (GMT) |
commit | 457509826ec0ed9c593c46d122e910f5cae36e58 (patch) | |
tree | bbcb47a015f8a78b8791bd05ede833d6928c4222 /Doc | |
parent | 63bf48768867a7421f8ccb956fe77f295bfd2742 (diff) | |
download | cpython-457509826ec0ed9c593c46d122e910f5cae36e58.zip cpython-457509826ec0ed9c593c46d122e910f5cae36e58.tar.gz cpython-457509826ec0ed9c593c46d122e910f5cae36e58.tar.bz2 |
Fix issue #27402: example for typing did not type-check.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/typing.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 731e2ec..317229d 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]) |