From 5a95e19322cbd68cadab1c50da0ef01d201cfd99 Mon Sep 17 00:00:00 2001 From: Roy Williams Date: Tue, 27 Jun 2017 14:24:22 -0700 Subject: [PATCH] Allow `csv` module to support both `str` and `unicode` types in Python 2 (#1437) * Replace keys in DictReader with Any --- stdlib/2and3/csv.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/2and3/csv.pyi b/stdlib/2and3/csv.pyi index 6683cccae..a61edcb41 100644 --- a/stdlib/2and3/csv.pyi +++ b/stdlib/2and3/csv.pyi @@ -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]