Skip to content

Fix positional-only differences in many stdlib modules #7226

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 2 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/argparse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ if sys.version_info >= (3, 9):
class Namespace(_AttributeHolder):
def __init__(self, **kwargs: Any) -> None: ...
def __getattr__(self, name: str) -> Any: ...
def __setattr__(self, name: str, value: Any) -> None: ...
def __setattr__(self, __name: str, __value: Any) -> None: ...
def __contains__(self, key: str) -> bool: ...

class FileType:
Expand Down
8 changes: 4 additions & 4 deletions stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ class complex:
def __add__(self, __x: complex) -> complex: ...
def __sub__(self, __x: complex) -> complex: ...
def __mul__(self, __x: complex) -> complex: ...
def __pow__(self, __x: complex, mod: None = ...) -> complex: ...
def __pow__(self, __x: complex, __mod: None = ...) -> complex: ...
def __truediv__(self, __x: complex) -> complex: ...
def __radd__(self, __x: complex) -> complex: ...
def __rsub__(self, __x: complex) -> complex: ...
Expand Down Expand Up @@ -444,7 +444,7 @@ class str(Sequence[str]):
def __mod__(self, __x: Any) -> str: ...
def __mul__(self, __n: SupportsIndex) -> str: ...
def __ne__(self, __x: object) -> bool: ...
def __rmul__(self, n: SupportsIndex) -> str: ...
def __rmul__(self, __n: SupportsIndex) -> str: ...
def __getnewargs__(self) -> tuple[str]: ...

class bytes(ByteString):
Expand Down Expand Up @@ -642,7 +642,7 @@ class bytearray(MutableSequence[int], ByteString):
@overload
def __getitem__(self, __s: slice) -> bytearray: ...
@overload
def __setitem__(self, __i: SupportsIndex, x: SupportsIndex) -> None: ...
def __setitem__(self, __i: SupportsIndex, __x: SupportsIndex) -> None: ...
@overload
def __setitem__(self, __s: slice, __x: Iterable[SupportsIndex] | bytes) -> None: ...
def __delitem__(self, __i: SupportsIndex | slice) -> None: ...
Expand Down Expand Up @@ -889,7 +889,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def pop(self, __key: _KT, __default: _VT | _T = ...) -> _VT | _T: ...
def __len__(self) -> int: ...
def __getitem__(self, __k: _KT) -> _VT: ...
def __setitem__(self, __k: _KT, v: _VT) -> None: ...
def __setitem__(self, __k: _KT, __v: _VT) -> None: ...
def __delitem__(self, __v: _KT) -> None: ...
def __iter__(self) -> Iterator[_KT]: ...
if sys.version_info >= (3, 8):
Expand Down
4 changes: 2 additions & 2 deletions stdlib/concurrent/futures/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ class DoneAndNotDoneFutures(Sequence[set[Future[_T]]]):
def __new__(_cls, done: set[Future[_T]], not_done: set[Future[_T]]) -> DoneAndNotDoneFutures[_T]: ...
def __len__(self) -> int: ...
@overload
def __getitem__(self, i: SupportsIndex) -> set[Future[_T]]: ...
def __getitem__(self, __i: SupportsIndex) -> set[Future[_T]]: ...
@overload
def __getitem__(self, s: slice) -> DoneAndNotDoneFutures[_T]: ...
def __getitem__(self, __s: slice) -> DoneAndNotDoneFutures[_T]: ...

def wait(fs: Iterable[Future[_T]], timeout: float | None = ..., return_when: str = ...) -> DoneAndNotDoneFutures[_T]: ...

Expand Down
2 changes: 1 addition & 1 deletion stdlib/contextvars.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ class Context(Mapping[ContextVar[Any], Any]):
def get(self, __key: ContextVar[_T], __default: _D) -> _T | _D: ...
def run(self, callable: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ...
def copy(self) -> Context: ...
def __getitem__(self, key: ContextVar[_T]) -> _T: ...
def __getitem__(self, __key: ContextVar[_T]) -> _T: ...
def __iter__(self) -> Iterator[ContextVar[Any]]: ...
def __len__(self) -> int: ...
2 changes: 1 addition & 1 deletion stdlib/email/charset.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Charset:
def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> list[str]: ...
def body_encode(self, string: str) -> str: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __ne__(self, __other: object) -> bool: ...

def add_charset(
charset: str, header_enc: int | None = ..., body_enc: int | None = ..., output_charset: str | None = ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/email/header.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Header:
def append(self, s: bytes | str, charset: Charset | str | None = ..., errors: str = ...) -> None: ...
def encode(self, splitchars: str = ..., maxlinelen: int | None = ..., linesep: str = ...) -> str: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __ne__(self, __other: object) -> bool: ...

def decode_header(header: Header | str) -> list[tuple[bytes, str | None]]: ...
def make_header(
Expand Down
12 changes: 6 additions & 6 deletions stdlib/ipaddress.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def ip_network(address: _RawIPAddress | _RawNetworkPart, strict: bool = ...) ->
def ip_interface(address: _RawIPAddress | _RawNetworkPart) -> IPv4Interface | IPv6Interface: ...

class _IPAddressBase:
def __eq__(self, other: object) -> bool: ...
def __ge__(self: Self, other: Self) -> bool: ...
def __gt__(self: Self, other: Self) -> bool: ...
def __le__(self: Self, other: Self) -> bool: ...
def __lt__(self: Self, other: Self) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __eq__(self, __other: object) -> bool: ...
def __ge__(self: Self, __other: Self) -> bool: ...
def __gt__(self: Self, __other: Self) -> bool: ...
def __le__(self: Self, __other: Self) -> bool: ...
def __lt__(self: Self, __other: Self) -> bool: ...
def __ne__(self, __other: object) -> bool: ...
@property
def compressed(self) -> str: ...
@property
Expand Down
10 changes: 5 additions & 5 deletions stdlib/mmap.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ class mmap(AbstractContextManager[mmap], Iterable[int], Sized):
def read(self, n: int | None = ...) -> bytes: ...
def write(self, bytes: ReadableBuffer) -> int: ...
@overload
def __getitem__(self, index: int) -> int: ...
def __getitem__(self, __index: int) -> int: ...
@overload
def __getitem__(self, index: slice) -> bytes: ...
def __delitem__(self, index: int | slice) -> NoReturn: ...
def __getitem__(self, __index: slice) -> bytes: ...
def __delitem__(self, __index: int | slice) -> NoReturn: ...
@overload
def __setitem__(self, index: int, object: int) -> None: ...
def __setitem__(self, __index: int, __object: int) -> None: ...
@overload
def __setitem__(self, index: slice, object: ReadableBuffer) -> None: ...
def __setitem__(self, __index: slice, __object: ReadableBuffer) -> None: ...
# Doesn't actually exist, but the object is actually iterable because it has __getitem__ and
# __len__, so we claim that there is also an __iter__ to help type checkers.
def __iter__(self) -> Iterator[int]: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/optparse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class Values:
def read_file(self, filename: str, mode: str = ...) -> None: ...
def read_module(self, modname: str, mode: str = ...) -> None: ...
def __getattr__(self, name: str) -> Any: ...
def __setattr__(self, name: str, value: Any) -> None: ...
def __setattr__(self, __name: str, __value: Any) -> None: ...

class OptionParser(OptionContainer):
allow_interspersed_args: bool
Expand Down
2 changes: 1 addition & 1 deletion stdlib/unittest/mock.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class _Call(tuple[Any, ...]):
self, value: Any = ..., name: Any | None = ..., parent: Any | None = ..., two: bool = ..., from_kall: bool = ...
) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __ne__(self, __other: object) -> bool: ...
def __call__(self, *args: Any, **kwargs: Any) -> _Call: ...
def __getattr__(self, attr: Any) -> Any: ...
if sys.version_info >= (3, 8):
Expand Down