Skip to content

Commit f869a5d

Browse files
matthiaskrammgvanrossum
authored andcommitted
fix bugs in stdlib/2/csv.py (#932)
1 parent 52dd490 commit f869a5d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/2/csv.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# NOTE: Based on a dynamically typed stub automatically generated by stubgen.
44

5-
from typing import Any, Dict, Iterable, List, Sequence, Union
5+
from typing import Any, Dict, Iterable, List, Sequence, Type, Union
66

77
# Public interface of _csv.reader's return type
88
class _Reader(Iterable[List[str]]):
@@ -11,7 +11,7 @@ class _Reader(Iterable[List[str]]):
1111

1212
def next(self) -> List[str]: ...
1313

14-
_Row = Sequence[Union[str, int]]
14+
_Row = Sequence[Any] # May contain anything: csv calls str() on the elements that are not None
1515

1616
# Public interface of _csv.writer's return type
1717
class _Writer:
@@ -27,7 +27,7 @@ QUOTE_NONNUMERIC = ... # type: int
2727

2828
class Error(Exception): ...
2929

30-
_Dialect = Union[str, Dialect]
30+
_Dialect = Union[str, Dialect, Type[Dialect]]
3131

3232
def writer(csvfile: Any, dialect: _Dialect = ..., **fmtparams) -> _Writer: ...
3333
def reader(csvfile: Iterable[str], dialect: _Dialect = ..., **fmtparams) -> _Reader: ...
@@ -66,7 +66,7 @@ class DictReader(Iterable):
6666
def __init__(self, f: Iterable[str], fieldnames: Sequence[Any] = ..., restkey=...,
6767
restval=..., dialect: _Dialect = ..., *args, **kwds) -> None: ...
6868
def __iter__(self): ...
69-
def __next__(self): ...
69+
def next(self): ...
7070

7171
_DictRow = Dict[Any, Union[str, int]]
7272

0 commit comments

Comments
 (0)