Skip to content

Annotate Python 3.8 removals #3359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 14, 2019
5 changes: 3 additions & 2 deletions stdlib/2and3/_codecs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ def raw_unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[
def readbuffer_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ...
def unicode_escape_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ...
def unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ...
def unicode_internal_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ...
def unicode_internal_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ...
if sys.version_info < (3, 8):
def unicode_internal_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ...
def unicode_internal_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_16_be_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ...
def utf_16_be_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_16_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ...
Expand Down
12 changes: 6 additions & 6 deletions stdlib/2and3/cgi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ _T = TypeVar('_T', bound=FieldStorage)

def parse(fp: IO[Any] = ..., environ: Mapping[str, str] = ...,
keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
if sys.version_info < (3, 8):
def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
if sys.version_info >= (3, 7):
def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes], encoding: str = ..., errors: str = ...) -> Dict[str, List[Any]]: ...
else:
Expand All @@ -17,11 +18,10 @@ def print_environ(environ: Mapping[str, str] = ...) -> None: ...
def print_form(form: Dict[str, Any]) -> None: ...
def print_directory() -> None: ...
def print_environ_usage() -> None: ...
if sys.version_info >= (3, 0):
def escape(s: str, quote: bool = ...) -> str: ...
else:
if sys.version_info < (3,):
def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ...

elif sys.version_info < (3, 8):
def escape(s: str, quote: bool = ...) -> str: ...

class MiniFieldStorage:
# The first five "Any" attributes here are always None, but mypy doesn't support that
Expand Down
56 changes: 38 additions & 18 deletions stdlib/2and3/fileinput.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,24 @@ if sys.version_info >= (3, 6):
else:
_Path = Union[Text, bytes]


def input(
files: Union[_Path, Iterable[_Path], None] = ...,
inplace: bool = ...,
backup: str = ...,
bufsize: int = ...,
mode: str = ...,
openhook: Callable[[_Path, str], IO[AnyStr]] = ...) -> FileInput[AnyStr]: ...

if sys.version_info >= (3, 8):
def input(
files: Union[_Path, Iterable[_Path], None] = ...,
inplace: bool = ...,
backup: str = ...,
*,
mode: str = ...,
openhook: Callable[[_Path, str], IO[AnyStr]] = ...,
) -> FileInput[AnyStr]: ...
else:
def input(
files: Union[_Path, Iterable[_Path], None] = ...,
inplace: bool = ...,
backup: str = ...,
bufsize: int = ...,
mode: str = ...,
openhook: Callable[[_Path, str], IO[AnyStr]] = ...,
) -> FileInput[AnyStr]: ...

def close() -> None: ...
def nextfile() -> None: ...
Expand All @@ -28,15 +37,26 @@ def isfirstline() -> bool: ...
def isstdin() -> bool: ...

class FileInput(Iterable[AnyStr], Generic[AnyStr]):
def __init__(
self,
files: Union[None, _Path, Iterable[_Path]] = ...,
inplace: bool = ...,
backup: str = ...,
bufsize: int = ...,
mode: str = ...,
openhook: Callable[[_Path, str], IO[AnyStr]] = ...
) -> None: ...
if sys.version_info >= (3, 8):
def __init__(
self,
files: Union[None, _Path, Iterable[_Path]] = ...,
inplace: bool = ...,
backup: str = ...,
*,
mode: str = ...,
openhook: Callable[[_Path, str], IO[AnyStr]] = ...
) -> None: ...
else:
def __init__(
self,
files: Union[None, _Path, Iterable[_Path]] = ...,
inplace: bool = ...,
backup: str = ...,
bufsize: int = ...,
mode: str = ...,
openhook: Callable[[_Path, str], IO[AnyStr]] = ...
) -> None: ...

def __del__(self) -> None: ...
def close(self) -> None: ...
Expand Down
Loading