mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
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:
@@ -1,4 +1,3 @@
|
||||
import sys
|
||||
import types
|
||||
from abc import abstractmethod
|
||||
from typing import (
|
||||
@@ -234,10 +233,7 @@ class StreamReaderWriter(TextIO):
|
||||
def read(self, size: int = ...) -> _Decoded: ...
|
||||
def readline(self, size: Optional[int] = ...) -> _Decoded: ...
|
||||
def readlines(self, sizehint: Optional[int] = ...) -> List[_Decoded]: ...
|
||||
if sys.version_info >= (3,):
|
||||
def __next__(self) -> Text: ...
|
||||
else:
|
||||
def next(self) -> Text: ...
|
||||
def __next__(self) -> Text: ...
|
||||
def __iter__(self: _T) -> _T: ...
|
||||
# This actually returns None, but that's incompatible with the supertype
|
||||
def write(self, data: _Decoded) -> int: ...
|
||||
@@ -277,10 +273,7 @@ class StreamRecoder(BinaryIO):
|
||||
def read(self, size: int = ...) -> bytes: ...
|
||||
def readline(self, size: Optional[int] = ...) -> bytes: ...
|
||||
def readlines(self, sizehint: Optional[int] = ...) -> List[bytes]: ...
|
||||
if sys.version_info >= (3,):
|
||||
def __next__(self) -> bytes: ...
|
||||
else:
|
||||
def next(self) -> bytes: ...
|
||||
def __next__(self) -> bytes: ...
|
||||
def __iter__(self: _SRT) -> _SRT: ...
|
||||
def write(self, data: bytes) -> int: ...
|
||||
def writelines(self, list: Iterable[bytes]) -> int: ... # type: ignore # it's supposed to return None
|
||||
|
||||
Reference in New Issue
Block a user