From: Guido van Rossum Date: Tue, 28 Jun 2016 17:08:17 +0000 (-0700) Subject: Fix issue #27402: example for typing did not type-check. X-Git-Tag: v3.6.0a3~54^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=457509826ec0ed9c593c46d122e910f5cae36e58;p=thirdparty%2FPython%2Fcpython.git Fix issue #27402: example for typing did not type-check. --- diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 731e2eca1611..317229de0cae 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])