diff --git a/stdlib/2/csv.pyi b/stdlib/2/csv.pyi index c91d3305e..51a57e41c 100644 --- a/stdlib/2/csv.pyi +++ b/stdlib/2/csv.pyi @@ -2,7 +2,7 @@ # # NOTE: Based on a dynamically typed stub automatically generated by stubgen. -from typing import Any, Dict, Iterable, List, Sequence, Union +from typing import Any, Dict, Iterable, List, Sequence, Type, Union # Public interface of _csv.reader's return type class _Reader(Iterable[List[str]]): @@ -11,7 +11,7 @@ class _Reader(Iterable[List[str]]): def next(self) -> List[str]: ... -_Row = Sequence[Union[str, int]] +_Row = Sequence[Any] # May contain anything: csv calls str() on the elements that are not None # Public interface of _csv.writer's return type class _Writer: @@ -27,7 +27,7 @@ QUOTE_NONNUMERIC = ... # type: int class Error(Exception): ... -_Dialect = Union[str, Dialect] +_Dialect = Union[str, Dialect, Type[Dialect]] def writer(csvfile: Any, dialect: _Dialect = ..., **fmtparams) -> _Writer: ... def reader(csvfile: Iterable[str], dialect: _Dialect = ..., **fmtparams) -> _Reader: ... @@ -66,7 +66,7 @@ class DictReader(Iterable): def __init__(self, f: Iterable[str], fieldnames: Sequence[Any] = ..., restkey=..., restval=..., dialect: _Dialect = ..., *args, **kwds) -> None: ... def __iter__(self): ... - def __next__(self): ... + def next(self): ... _DictRow = Dict[Any, Union[str, int]]