Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)

* run script and do some manual changes (Akuli)

* do the whole thing manually (srittau)

* merge changes (Akuli)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
Akuli
2021-05-15 15:33:39 +03:00
committed by GitHub
parent b0ef85288d
commit 17dcea4a68
106 changed files with 1539 additions and 3275 deletions

View File

@@ -1,5 +1,4 @@
import sys
from typing import Any, Iterable, Iterator, List, Optional, Protocol, Sequence, Text, Type, Union
from typing import Any, Iterable, Iterator, List, Optional, Protocol, Text, Type, Union
QUOTE_ALL: int
QUOTE_MINIMAL: int
@@ -24,20 +23,12 @@ _DialectLike = Union[str, Dialect, Type[Dialect]]
class _reader(Iterator[List[str]]):
dialect: Dialect
line_num: int
if sys.version_info >= (3, 0):
def __next__(self) -> List[str]: ...
else:
def next(self) -> List[str]: ...
def __next__(self) -> List[str]: ...
class _writer:
dialect: Dialect
if sys.version_info >= (3, 5):
def writerow(self, row: Iterable[Any]) -> Any: ...
def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ...
else:
def writerow(self, row: Sequence[Any]) -> Any: ...
def writerows(self, rows: Iterable[Sequence[Any]]) -> None: ...
def writerow(self, row: Iterable[Any]) -> Any: ...
def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ...
class _Writer(Protocol):
def write(self, s: str) -> Any: ...