Skip to content

Commit 7acc348

Browse files
author
Guido van Rossum
committed
Fix issue #27402: example for typing did not type-check. (Merge 3.5->3.6)
2 parents 5eef78b + 4575098 commit 7acc348

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/typing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ The module defines the following classes, functions and decorators:
427427
def vec2(x: T, y: T) -> List[T]:
428428
return [x, y]
429429

430-
def slice__to_4(vector: Sequence[T]) -> List[T]:
431-
return vector[0:4]
430+
def keep_positives(vector: Sequence[T]) -> List[T]:
431+
return [item for item in vector if item > 0]
432432

433433
.. class:: Set(set, MutableSet[T])
434434

0 commit comments

Comments
 (0)