Fix an argument to csv.DictReader() (#3339)

From the Lib/csv.py source, 'f' is passed directly to _csv.reader, which
expects Iterable[Text]
This commit is contained in:
Martin DeMello
2019-10-10 20:13:20 -07:00
committed by Jelle Zijlstra
parent fc23c8274f
commit d0beab9b8e

View File

@@ -1,6 +1,6 @@
from collections import OrderedDict
import sys
from typing import Any, Dict, Iterable, Iterator, List, Mapping, Optional, Sequence, Type, Union
from typing import Any, Dict, Iterable, Iterator, List, Mapping, Optional, Sequence, Text, Type, Union
from _csv import (_reader,
_writer,
@@ -64,7 +64,7 @@ class DictReader(Iterator[_DRMapping]):
dialect: _Dialect
line_num: int
fieldnames: Sequence[str]
def __init__(self, f: Iterable[str], fieldnames: Sequence[str] = ...,
def __init__(self, f: Iterable[Text], fieldnames: Sequence[str] = ...,
restkey: Optional[str] = ..., restval: Optional[str] = ..., dialect: _Dialect = ...,
*args: Any, **kwds: Any) -> None: ...
def __iter__(self) -> DictReader: ...