8000 Allow `csv` module to support both `str` and `unicode` types in Pytho… · python/typeshed@5a95e19 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a95e19

Browse files
rowilliaJelleZijlstra
authored andcommitted
Allow csv module to support both str and unicode types in Python 2 (#1437)
* Replace keys in DictReader with Any
1 parent 22f47fd commit 5a95e19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/2and3/csv.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if sys.version_info >= (3, 6):
6565
def __iter__(self) -> Iterator[OrderedDict[str, str]]: ...
6666
def next(self) -> OrderedDict[str, str]: ...
6767
else:
68-
class DictReader(Iterator[Dict[str, str]]):
68+
class DictReader(Iterator[Dict[Any, str]]):
6969
restkey = ... # type: Optional[str]
7070
restval = ... # type: Optional[str]
7171
reader = ... # type: _reader
@@ -75,8 +75,8 @@ else:
7575
def __init__(self, f: Iterator[str], fieldnames: Sequence[str] = ...,
7676
restkey: Optional[str] = ..., restval: Optional[str] = ..., dialect: _Dialect = ...,
7777
*args: Any, **kwds: Any) -> None: ...
78-
def __iter__(self) -> Iterator[OrderedDict[str, str]]: ...
79-
def next(self) -> OrderedDict[str, str]: ...
78+
def __iter__(self) -> Iterator[OrderedDict[Any, str]]: ...
79+
def next(self) -> OrderedDict[Any, str]: ...
8080

8181
class DictWriter(object):
8282
fieldnames = ... # type: Sequence[str]
0