PY-21244 Fix type annotations for the built-in function "map"

This commit is contained in:
Mikhail Golubev
2016-11-07 20:44:44 +03:00
parent 29cefc5859
commit 44744a74bd
7 changed files with 42 additions and 12 deletions

View File

@@ -202,9 +202,9 @@ def map(function, sequence, *sequence_1):
"""Return a list of the results of applying the function to the items of
the argument sequence(s).
:type function: ((T) -> V) | None
:type function: None | (T) -> V
:type sequence: collections.Iterable[T]
:rtype: list[V] | bytes | unicode
:rtype: list[V]
"""
pass

View File

@@ -195,16 +195,28 @@ def max(*args, key=None, default=None):
pass
def map(function, sequence, *sequence_1):
"""Return a list of the results of applying the function to the items of
the argument sequence(s).
class map(object):
def __init__(self, function, sequence, *sequence_1):
"""Return an iterable of the results of applying the function to the items of
the argument sequence(s).
:type function: ((T) -> V) | None
:type sequence: collections.Iterable[T]
:rtype: list[V] | bytes | str
"""
pass
:type function: None | (T) -> V
:type sequence: collections.Iterable[T]
:rtype: map[T, V]
"""
pass
def __iter__(self):
"""
:rtype: collections.Iterator[V]
"""
return self
def __next__(self):
"""
:rtype: V
"""
pass
def min(*args, key=None, default=None):
"""Return the smallest item in an iterable or the smallest of two or more