2
2
#
3
3
# NOTE: Based on a dynamically typed stub automatically generated by stubgen.
4
4
5
- from typing import Any , Dict , Iterable , List , Sequence , Union
5
+ from typing import Any , Dict , Iterable , List , Sequence , Type , Union
6
6
7
7
# Public interface of _csv.reader's return type
8
8
class _Reader (Iterable [List [str ]]):
@@ -11,7 +11,7 @@ class _Reader(Iterable[List[str]]):
11
11
12
12
def next (self ) -> List [str ]: ...
13
13
14
- _Row = Sequence [Union [ str , int ]]
14
+ _Row = Sequence [Any ] # May contain anything: csv calls str() on the elements that are not None
15
15
16
16
# Public interface of _csv.writer's return type
17
17
class _Writer :
@@ -27,7 +27,7 @@ QUOTE_NONNUMERIC = ... # type: int
27
27
28
28
class Error (Exception ): ...
29
29
30
- _Dialect = Union [str , Dialect ]
30
+ _Dialect = Union [str , Dialect , Type [ Dialect ] ]
31
31
32
32
def writer (csvfile : Any , dialect : _Dialect = ..., ** fmtparams ) -> _Writer : ...
33
33
def reader (csvfile : Iterable [str ], dialect : _Dialect = ..., ** fmtparams ) -> _Reader : ...
@@ -66,7 +66,7 @@ class DictReader(Iterable):
66
66
def __init__ (self , f : Iterable [str ], fieldnames : Sequence [Any ] = ..., restkey = ...,
67
67
restval = ..., dialect : _Dialect = ..., * args , ** kwds ) -> None : ...
68
68
def __iter__ (self ): ...
69
- def __next__ (self ): ...
69
+ def next (self ): ...
70
70
71
71
_DictRow = Dict [Any , Union [str , int ]]
72
72
0 commit comments