diff --git a/stdlib/2.7/csv.pyi b/stdlib/2.7/csv.pyi index ce330105e..c91d3305e 100644 --- a/stdlib/2.7/csv.pyi +++ b/stdlib/2.7/csv.pyi @@ -2,27 +2,22 @@ # # NOTE: Based on a dynamically typed stub automatically generated by stubgen. -from abc import ABCMeta, abstractmethod from typing import Any, Dict, Iterable, List, Sequence, Union -# Public interface of _csv.reader -class Reader(Iterable[List[str]], metaclass=ABCMeta): +# Public interface of _csv.reader's return type +class _Reader(Iterable[List[str]]): dialect = ... # type: Dialect line_num = ... # type: int - @abstractmethod def next(self) -> List[str]: ... _Row = Sequence[Union[str, int]] -# Public interface of _csv.writer -class Writer(metaclass=ABCMeta): +# Public interface of _csv.writer's return type +class _Writer: dialect = ... # type: Dialect - @abstractmethod def writerow(self, row: _Row) -> None: ... - - @abstractmethod def writerows(self, rows: Iterable[_Row]) -> None: ... QUOTE_ALL = ... # type: int @@ -34,8 +29,8 @@ class Error(Exception): ... _Dialect = Union[str, Dialect] -def writer(csvfile: Any, dialect: _Dialect = ..., **fmtparams) -> Writer: ... -def reader(csvfile: Iterable[str], dialect: _Dialect = ..., **fmtparams) -> Reader: ... +def writer(csvfile: Any, dialect: _Dialect = ..., **fmtparams) -> _Writer: ... +def reader(csvfile: Iterable[str], dialect: _Dialect = ..., **fmtparams) -> _Reader: ... def register_dialect(name, dialect=..., **fmtparams): ... def unregister_dialect(name): ... def get_dialect(name: str) -> Dialect: ...