@@ -59,11 +59,11 @@ if sys.version_info >= (3, 6):
5959 dialect = ... # type: _Dialect
6060 line_num = ... # type: int
6161 fieldnames = ... # type: Sequence[str]
62- def __init__ (self , f : Iterator [str ], fieldnames : Sequence [str ] = ...,
62+ def __init__ (self , f : Iterable [str ], fieldnames : Sequence [str ] = ...,
6363 restkey : Optional [str ] = ..., restval : Optional [str ] = ..., dialect : _Dialect = ...,
6464 * args : Any , ** kwds : Any ) -> None : ...
65- def __iter__ (self ) -> Iterator [ OrderedDict [ str , str ]] : ...
66- def next (self ) -> OrderedDict [str , str ]: ...
65+ def __iter__ (self ) -> 'DictReader' : ...
66+ def __next__ (self ) -> OrderedDict [str , str ]: ...
6767else :
6868 class DictReader (Iterator [Dict [Any , str ]]):
6969 restkey = ... # type: Optional[str]
@@ -72,11 +72,14 @@ else:
7272 dialect = ... # type: _Dialect
7373 line_num = ... # type: int
7474 fieldnames = ... # type: Sequence[str]
75- def __init__ (self , f : Iterator [str ], fieldnames : Sequence [str ] = ...,
75+ def __init__ (self , f : Iterable [str ], fieldnames : Sequence [str ] = ...,
7676 restkey : Optional [str ] = ..., restval : Optional [str ] = ..., dialect : _Dialect = ...,
7777 * args : Any , ** kwds : Any ) -> None : ...
78- def __iter__ (self ) -> Iterator [OrderedDict [Any , str ]]: ...
79- def next (self ) -> OrderedDict [Any , str ]: ...
78+ def __iter__ (self ) -> 'DictReader' : ...
79+ if sys .version_info >= (3 ,):
80+ def __next__ (self ) -> OrderedDict [Any , str ]: ...
81+ else :
82+ def next (self ) -> OrderedDict [Any , str ]: ...
8083
8184class DictWriter (object ):
8285 fieldnames = ... # type: Sequence[str]
0 commit comments