diff --git a/stdlib/2and3/csv.pyi b/stdlib/2and3/csv.pyi index a61edcb411ac..9774f518b086 100644 --- a/stdlib/2and3/csv.pyi +++ b/stdlib/2and3/csv.pyi @@ -59,11 +59,11 @@ if sys.version_info >= (3, 6): dialect = ... # type: _Dialect line_num = ... # type: int fieldnames = ... # type: Sequence[str] - def __init__(self, f: Iterator[str], fieldnames: Sequence[str] = ..., + def __init__(self, f: Iterable[str], fieldnames: Sequence[str] = ..., restkey: Optional[str] = ..., restval: Optional[str] = ..., dialect: _Dialect = ..., *args: Any, **kwds: Any) -> None: ... - def __iter__(self) -> Iterator[OrderedDict[str, str]]: ... - def next(self) -> OrderedDict[str, str]: ... + def __iter__(self) -> 'DictReader': ... + def __next__(self) -> OrderedDict[str, str]: ... else: class DictReader(Iterator[Dict[Any, str]]): restkey = ... # type: Optional[str] @@ -72,11 +72,14 @@ else: dialect = ... # type: _Dialect line_num = ... # type: int fieldnames = ... # type: Sequence[str] - def __init__(self, f: Iterator[str], fieldnames: Sequence[str] = ..., + def __init__(self, f: Iterable[str], fieldnames: Sequence[str] = ..., restkey: Optional[str] = ..., restval: Optional[str] = ..., dialect: _Dialect = ..., *args: Any, **kwds: Any) -> None: ... - def __iter__(self) -> Iterator[OrderedDict[Any, str]]: ... - def next(self) -> OrderedDict[Any, str]: ... + def __iter__(self) -> 'DictReader': ... + if sys.version_info >= (3,): + def __next__(self) -> OrderedDict[Any, str]: ... + else: + def next(self) -> OrderedDict[Any, str]: ... class DictWriter(object): fieldnames = ... # type: Sequence[str]