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