builtins: default values for int.(to|from)_bytes in py311 (#7647)

See https://github.com/python/cpython/issues/89318
This commit is contained in:
Shantanu
2022-04-16 16:57:13 -07:00
committed by GitHub
parent c93f92d92e
commit 520f807b5f

View File

@@ -218,15 +218,29 @@ class int:
if sys.version_info >= (3, 10):
def bit_count(self) -> int: ...
def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = ...) -> bytes: ...
@classmethod
def from_bytes(
cls: type[Self],
bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
byteorder: Literal["little", "big"],
*,
signed: bool = ...,
) -> Self: ...
if sys.version_info >= (3, 11):
def to_bytes(
self, length: SupportsIndex = ..., byteorder: Literal["little", "big"] = ..., *, signed: bool = ...
) -> bytes: ...
@classmethod
def from_bytes(
cls: type[Self],
bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
byteorder: Literal["little", "big"] = ...,
*,
signed: bool = ...,
) -> Self: ...
else:
def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = ...) -> bytes: ...
@classmethod
def from_bytes(
cls: type[Self],
bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
byteorder: Literal["little", "big"],
*,
signed: bool = ...,
) -> Self: ...
def __add__(self, __x: int) -> int: ...
def __sub__(self, __x: int) -> int: ...
def __mul__(self, __x: int) -> int: ...