@@ -59,11 +59,11 @@ if sys.version_info >= (3, 6):
59
59
dialect = ... # type: _Dialect
60
60
line_num = ... # type: int
61
61
fieldnames = ... # type: Sequence[str]
62
- def __init__ (self , f : Iterator [str ], fieldnames : Sequence [str ] = ...,
62
+ def __init__ (self , f : Iterable [str ], fieldnames : Sequence [str ] = ...,
63
63
restkey : Optional [str ] = ..., restval : Optional [str ] = ..., dialect : _Dialect = ...,
64
64
* 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 ]: ...
67
67
else :
68
68
class DictReader (Iterator [Dict [Any , str ]]):
69
69
restkey = ... # type: Optional[str]
@@ -72,11 +72,14 @@ else:
72
72
dialect = ... # type: _Dialect
73
73
line_num = ... # type: int
74
74
fieldnames = ... # type: Sequence[str]
75
- def __init__ (self , f : Iterator [str ], fieldnames : Sequence [str ] = ...,
75
+ def __init__ (self , f : Iterable [str ], fieldnames : Sequence [str ] = ...,
76
76
restkey : Optional [str ] = ..., restval : Optional [str ] = ..., dialect : _Dialect = ...,
77
77
* 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 ]: ...
80
83
81
84
class DictWriter (object ):
82
85
fieldnames = ... # type: Sequence[str]
0 commit comments