@@ -51,35 +51,30 @@ if sys.version_info >= (3,):
51
51
lineterminator = ... # type: str
52
52
quoting = ... # type: int
53
53
54
+
54
55
if sys .version_info >= (3 , 6 ):
55
- class DictReader (Iterator [OrderedDict [str , str ]]):
56
- restkey = ... # type: Optional[str]
57
- restval = ... # type: Optional[str]
58
- reader = ... # type: _reader
59
- dialect = ... # type: _Dialect
60
- line_num = ... # type: int
61
- fieldnames = ... # type: Sequence[str]
62
- def __init__ (self , f : Iterable [str ], fieldnames : Sequence [str ] = ...,
63
- restkey : Optional [str ] = ..., restval : Optional [str ] = ..., dialect : _Dialect = ...,
64
- * args : Any , ** kwds : Any ) -> None : ...
65
- def __iter__ (self ) -> 'DictReader' : ...
66
- def __next__ (self ) -> OrderedDict [str , str ]: ...
56
+ _DRMapping = OrderedDict [str , str ]
67
57
else :
68
- class DictReader (Iterator [Dict [Any , str ]]):
69
- restkey = ... # type: Optional[str]
70
- restval = ... # type: Optional[str]
71
- reader = ... # type: _reader
72
- dialect = ... # type: _Dialect
73
- line_num = ... # type: int
74
- fieldnames = ... # type: Sequence[str]
75
- def __init__ (self , f : Iterable [str ], fieldnames : Sequence [str ] = ...,
76
- restkey : Optional [str ] = ..., restval : Optional [str ] = ..., dialect : _Dialect = ...,
77
- * args : Any , ** kwds : Any ) -> None : ...
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 ]: ...
58
+ _DRMapping = Dict [str , str ]
59
+
60
+
61
+ class DictReader (Iterator [_DRMapping ]):
62
+ restkey = ... # type: Optional[str]
63
+ restval = ... # type: Optional[str]
64
+ reader = ... # type: _reader
65
+ dialect = ... # type: _Dialect
66
+ line_num = ... # type: int
67
+ fieldnames = ... # type: Sequence[str]
68
+ def __init__ (self , f : Iterable [str ], fieldnames : Sequence [str ] = ...,
69
+ restkey : Optional [str ] = ..., restval : Optional [str ] = ..., dialect : _Dialect = ...,
70
+ * args : Any , ** kwds : Any ) -> None : ...
71
+ def __iter__ (self ) -> 'DictReader' : ...
72
+ def __next__ (self ) -> _DRMapping : ...
73
+ if sys .version_info >= (3 ,):
74
+ def __next__ (self ) -> _DRMapping : ...
75
+ else :
76
+ def next (self ) -> _DRMapping : ...
77
+
83
78
84
79
class DictWriter (object ):
85
80
fieldnames = ... # type: Sequence[str]
0 commit comments