Allow csv module to support both str and unicode types in Python 2 (#1437)

* Replace keys in DictReader with Any
This commit is contained in:
Roy Williams
2017-06-27 14:24:22 -07:00
committed by Jelle Zijlstra
parent 22f47fd478
commit 5a95e19322

View File

@@ -65,7 +65,7 @@ if sys.version_info >= (3, 6):
def __iter__(self) -> Iterator[OrderedDict[str, str]]: ...
def next(self) -> OrderedDict[str, str]: ...
else:
class DictReader(Iterator[Dict[str, str]]):
class DictReader(Iterator[Dict[Any, str]]):
restkey = ... # type: Optional[str]
restval = ... # type: Optional[str]
reader = ... # type: _reader
@@ -75,8 +75,8 @@ else:
def __init__(self, f: Iterator[str], fieldnames: Sequence[str] = ...,
restkey: Optional[str] = ..., restval: Optional[str] = ..., dialect: _Dialect = ...,
*args: Any, **kwds: Any) -> None: ...
def __iter__(self) -> Iterator[OrderedDict[str, str]]: ...
def next(self) -> OrderedDict[str, str]: ...
def __iter__(self) -> Iterator[OrderedDict[Any, str]]: ...
def next(self) -> OrderedDict[Any, str]: ...
class DictWriter(object):
fieldnames = ... # type: Sequence[str]