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,18 +1,13 @@
import sys
from typing import IO, Any, Callable, Iterator, List, MutableMapping, Optional, Text, Tuple, Type, Union
_Reader = Callable[[IO[bytes]], Any]
if sys.version_info >= (3, 0):
bytes_types: Tuple[Type[Any], ...]
bytes_types: Tuple[Type[Any], ...]
UP_TO_NEWLINE: int
TAKEN_FROM_ARGUMENT1: int
TAKEN_FROM_ARGUMENT4: int
if sys.version_info >= (3, 3):
TAKEN_FROM_ARGUMENT4U: int
if sys.version_info >= (3, 4):
TAKEN_FROM_ARGUMENT8U: int
TAKEN_FROM_ARGUMENT4U: int
TAKEN_FROM_ARGUMENT8U: int
class ArgumentDescriptor(object):
name: str
@@ -33,13 +28,13 @@ def read_int4(f: IO[bytes]) -> int: ...
int4: ArgumentDescriptor
if sys.version_info >= (3, 3):
def read_uint4(f: IO[bytes]) -> int: ...
uint4: ArgumentDescriptor
def read_uint4(f: IO[bytes]) -> int: ...
if sys.version_info >= (3, 5):
def read_uint8(f: IO[bytes]) -> int: ...
uint8: ArgumentDescriptor
uint4: ArgumentDescriptor
def read_uint8(f: IO[bytes]) -> int: ...
uint8: ArgumentDescriptor
def read_stringnl(f: IO[bytes], decode: bool = ..., stripquotes: bool = ...) -> Union[bytes, Text]: ...
@@ -61,31 +56,33 @@ def read_string4(f: IO[bytes]) -> str: ...
string4: ArgumentDescriptor
if sys.version_info >= (3, 3):
def read_bytes1(f: IO[bytes]) -> bytes: ...
bytes1: ArgumentDescriptor
def read_bytes4(f: IO[bytes]) -> bytes: ...
bytes4: ArgumentDescriptor
def read_bytes1(f: IO[bytes]) -> bytes: ...
if sys.version_info >= (3, 4):
def read_bytes8(f: IO[bytes]) -> bytes: ...
bytes8: ArgumentDescriptor
bytes1: ArgumentDescriptor
def read_bytes4(f: IO[bytes]) -> bytes: ...
bytes4: ArgumentDescriptor
def read_bytes8(f: IO[bytes]) -> bytes: ...
bytes8: ArgumentDescriptor
def read_unicodestringnl(f: IO[bytes]) -> Text: ...
unicodestringnl: ArgumentDescriptor
if sys.version_info >= (3, 4):
def read_unicodestring1(f: IO[bytes]) -> Text: ...
unicodestring1: ArgumentDescriptor
def read_unicodestring1(f: IO[bytes]) -> Text: ...
unicodestring1: ArgumentDescriptor
def read_unicodestring4(f: IO[bytes]) -> Text: ...
unicodestring4: ArgumentDescriptor
if sys.version_info >= (3, 4):
def read_unicodestring8(f: IO[bytes]) -> Text: ...
unicodestring8: ArgumentDescriptor
def read_unicodestring8(f: IO[bytes]) -> Text: ...
unicodestring8: ArgumentDescriptor
def read_decimalnl_short(f: IO[bytes]) -> int: ...
def read_decimalnl_long(f: IO[bytes]) -> int: ...
@@ -120,19 +117,16 @@ pylong: StackObject
pyinteger_or_bool: StackObject
pybool: StackObject
pyfloat: StackObject
if sys.version_info >= (3, 4):
pybytes_or_str: StackObject
pybytes_or_str: StackObject
pystring: StackObject
if sys.version_info >= (3, 0):
pybytes: StackObject
pybytes: StackObject
pyunicode: StackObject
pynone: StackObject
pytuple: StackObject
pylist: StackObject
pydict: StackObject
if sys.version_info >= (3, 4):
pyset: StackObject
pyfrozenset: StackObject
pyset: StackObject
pyfrozenset: StackObject
anyobject: StackObject
markobject: StackObject
stackslice: StackObject
@@ -160,20 +154,10 @@ opcodes: List[OpcodeInfo]
def genops(pickle: Union[bytes, IO[bytes]]) -> Iterator[Tuple[OpcodeInfo, Optional[Any], Optional[int]]]: ...
def optimize(p: Union[bytes, IO[bytes]]) -> bytes: ...
if sys.version_info >= (3, 2):
def dis(
pickle: Union[bytes, IO[bytes]],
out: Optional[IO[str]] = ...,
memo: Optional[MutableMapping[int, Any]] = ...,
indentlevel: int = ...,
annotate: int = ...,
) -> None: ...
else:
def dis(
pickle: Union[bytes, IO[bytes]],
out: Optional[IO[str]] = ...,
memo: Optional[MutableMapping[int, Any]] = ...,
indentlevel: int = ...,
) -> None: ...
def dis(
pickle: Union[bytes, IO[bytes]],
out: Optional[IO[str]] = ...,
memo: Optional[MutableMapping[int, Any]] = ...,
indentlevel: int = ...,
annotate: int = ...,
) -> None: ...