Audit stdlib object annotations (#9519)

This commit is contained in:
Avasam
2023-01-17 10:40:00 -05:00
committed by GitHub
parent 3d6b8dccfe
commit c70d303985
31 changed files with 79 additions and 79 deletions

View File

@@ -1,4 +1,4 @@
from _typeshed import FileDescriptorLike
from _typeshed import FileDescriptorLike, Unused
from collections.abc import Sequence
from struct import Struct
from typing import Any
@@ -19,7 +19,7 @@ def main(
alive_r: FileDescriptorLike,
preload: Sequence[str],
main_path: str | None = ...,
sys_path: object | None = ...,
sys_path: Unused = ...,
) -> None: ...
def read_signed(fd: int) -> Any: ...
def write_signed(fd: int, n: int) -> None: ...

View File

@@ -1,6 +1,6 @@
import pickle
import sys
from _typeshed import HasFileno, SupportsWrite
from _typeshed import HasFileno, SupportsWrite, Unused
from abc import ABCMeta
from builtins import type as Type # alias to avoid name clash
from collections.abc import Callable
@@ -54,8 +54,7 @@ else:
ACKNOWLEDGE: Literal[False]
def recvfds(sock: socket, size: int) -> list[int]: ...
# destination_pid is unused
def send_handle(conn: HasFileno, handle: int, destination_pid: object) -> None: ...
def send_handle(conn: HasFileno, handle: int, destination_pid: Unused) -> None: ...
def recv_handle(conn: HasFileno) -> int: ...
def sendfds(sock: socket, fds: list[int]) -> None: ...
def DupFd(fd: int) -> Any: ... # Return type is really hard to get right
@@ -92,5 +91,4 @@ class AbstractReducer(metaclass=ABCMeta):
sendfds = _sendfds
recvfds = _recvfds
DupFd = _DupFd
# *args are unused
def __init__(self, *args: object) -> None: ...
def __init__(self, *args: Unused) -> None: ...

View File

@@ -1,5 +1,5 @@
import threading
from _typeshed import Incomplete, ReadableBuffer, SupportsTrunc
from _typeshed import Incomplete, ReadableBuffer, SupportsTrunc, Unused
from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence
from logging import Logger, _Level as _LoggingLevel
from typing import Any, SupportsInt
@@ -56,7 +56,7 @@ class Finalize:
) -> None: ...
def __call__(
self,
wr: object = ...,
wr: Unused = ...,
_finalizer_registry: MutableMapping[Incomplete, Incomplete] = ...,
sub_debug: Callable[..., object] = ...,
getpid: Callable[[], int] = ...,
@@ -70,7 +70,7 @@ class ForkAwareThreadLock:
acquire: Callable[[bool, float], bool]
release: Callable[[], None]
def __enter__(self) -> bool: ...
def __exit__(self, *args: object) -> None: ...
def __exit__(self, *args: Unused) -> None: ...
class ForkAwareLocal(threading.local): ...