From ebedc98d04ba1da0a44c9d82ee04c9c54b73a7a7 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Mon, 25 Jul 2022 12:46:34 -0700 Subject: [PATCH 1/4] Use Callable[..., Any] instead of Callable[..., object] Workaround https://github.com/python/mypy/issues/13220 --- stdlib/_compression.pyi | 2 +- stdlib/_dummy_thread.pyi | 2 +- stdlib/_dummy_threading.pyi | 4 +- stdlib/_thread.pyi | 2 +- stdlib/_typeshed/__init__.pyi | 2 +- stdlib/_typeshed/wsgi.pyi | 2 +- stdlib/asyncio/base_events.pyi | 10 ++-- stdlib/asyncio/base_subprocess.pyi | 2 +- stdlib/asyncio/coroutines.pyi | 2 +- stdlib/asyncio/events.pyi | 24 ++++----- stdlib/asyncio/futures.pyi | 4 +- stdlib/asyncio/sslproto.pyi | 4 +- stdlib/asyncio/unix_events.pyi | 12 ++--- stdlib/asyncio/windows_utils.pyi | 2 +- stdlib/atexit.pyi | 2 +- stdlib/builtins.pyi | 16 +++--- stdlib/concurrent/futures/_base.pyi | 2 +- stdlib/concurrent/futures/process.pyi | 8 +-- stdlib/concurrent/futures/thread.pyi | 7 +-- stdlib/distutils/ccompiler.pyi | 2 +- stdlib/distutils/cmd.pyi | 4 +- stdlib/distutils/util.pyi | 2 +- stdlib/doctest.pyi | 6 +-- stdlib/email/mime/application.pyi | 2 +- stdlib/email/mime/audio.pyi | 2 +- stdlib/email/mime/image.pyi | 2 +- stdlib/ftplib.pyi | 10 ++-- stdlib/functools.pyi | 2 +- stdlib/gc.pyi | 2 +- stdlib/inspect.pyi | 4 +- stdlib/itertools.pyi | 2 +- stdlib/lib2to3/pgen2/tokenize.pyi | 2 +- stdlib/multiprocessing/context.pyi | 4 +- stdlib/multiprocessing/dummy/__init__.pyi | 4 +- stdlib/multiprocessing/managers.pyi | 4 +- stdlib/multiprocessing/pool.pyi | 30 +++++------ stdlib/multiprocessing/process.pyi | 2 +- stdlib/multiprocessing/synchronize.pyi | 2 +- stdlib/os/__init__.pyi | 12 ++--- stdlib/pkgutil.pyi | 2 +- stdlib/pydoc.pyi | 6 +-- stdlib/readline.pyi | 4 +- stdlib/sched.pyi | 4 +- stdlib/shutil.pyi | 20 +++---- stdlib/sqlite3/dbapi2.pyi | 10 ++-- stdlib/telnetlib.pyi | 2 +- stdlib/threading.pyi | 4 +- stdlib/timeit.pyi | 4 +- stdlib/turtle.pyi | 26 +++++----- stdlib/types.pyi | 4 +- stdlib/typing.pyi | 6 +-- stdlib/typing_extensions.pyi | 6 +-- stdlib/unittest/case.pyi | 22 ++++---- stdlib/urllib/request.pyi | 4 +- stdlib/urllib/response.pyi | 4 +- stdlib/weakref.pyi | 2 +- stdlib/wsgiref/types.pyi | 2 +- stdlib/xdrlib.pyi | 6 +-- stdlib/xml/etree/ElementTree.pyi | 2 +- stdlib/xmlrpc/client.pyi | 2 +- stubs/JACK-Client/jack/__init__.pyi | 32 ++++++------ .../sqlalchemy/engine/interfaces.pyi | 4 +- .../aws_xray_sdk/core/recorder.pyi | 2 +- stubs/boto/boto/s3/key.pyi | 22 ++++---- stubs/fpdf2/fpdf/fpdf.pyi | 2 +- stubs/gdb/gdb/__init__.pyi | 6 +-- stubs/gdb/gdb/events.pyi | 52 +++++++++---------- .../google/cloud/ndb/model.pyi | 16 +++--- stubs/invoke/invoke/util.pyi | 4 +- .../opentracing/harness/scope_check.pyi | 2 +- stubs/paramiko/paramiko/channel.pyi | 4 +- stubs/paramiko/paramiko/dsskey.pyi | 2 +- stubs/paramiko/paramiko/ecdsakey.pyi | 2 +- stubs/paramiko/paramiko/packet.pyi | 2 +- stubs/paramiko/paramiko/rsakey.pyi | 2 +- stubs/paramiko/paramiko/sftp_client.pyi | 2 +- stubs/paramiko/paramiko/transport.pyi | 2 +- stubs/prettytable/prettytable/colortable.pyi | 2 +- stubs/psutil/psutil/__init__.pyi | 2 +- stubs/pyOpenSSL/OpenSSL/SSL.pyi | 2 +- stubs/pynput/pynput/_util.pyi | 2 +- stubs/pynput/pynput/keyboard/__init__.pyi | 2 +- stubs/pysftp/pysftp/__init__.pyi | 2 +- stubs/pysftp/pysftp/helpers.pyi | 2 +- stubs/python-nmap/nmap/nmap.pyi | 2 +- stubs/redis/redis/asyncio/connection.pyi | 2 +- stubs/redis/redis/connection.pyi | 2 +- stubs/redis/redis/retry.pyi | 2 +- stubs/setuptools/pkg_resources/__init__.pyi | 2 +- .../setuptools/_distutils/ccompiler.pyi | 2 +- .../setuptools/setuptools/_distutils/cmd.pyi | 4 +- .../setuptools/setuptools/_distutils/util.pyi | 2 +- stubs/six/six/__init__.pyi | 2 +- stubs/tqdm/tqdm/utils.pyi | 2 +- stubs/waitress/waitress/runner.pyi | 2 +- stubs/waitress/waitress/trigger.pyi | 2 +- 96 files changed, 271 insertions(+), 278 deletions(-) diff --git a/stdlib/_compression.pyi b/stdlib/_compression.pyi index ec3c7fe70856..57edb9812be3 100644 --- a/stdlib/_compression.pyi +++ b/stdlib/_compression.pyi @@ -16,7 +16,7 @@ class DecompressReader(RawIOBase): def __init__( self, fp: _Reader, - decomp_factory: Callable[..., object], + decomp_factory: Callable[..., Any], trailing_error: type[Exception] | tuple[type[Exception], ...] = ..., **decomp_args: Any, ) -> None: ... diff --git a/stdlib/_dummy_thread.pyi b/stdlib/_dummy_thread.pyi index 463399ca43db..4cc9b9bc1b77 100644 --- a/stdlib/_dummy_thread.pyi +++ b/stdlib/_dummy_thread.pyi @@ -7,7 +7,7 @@ __all__ = ["error", "start_new_thread", "exit", "get_ident", "allocate_lock", "i TIMEOUT_MAX: int error = RuntimeError -def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any] = ...) -> None: ... +def start_new_thread(function: Callable[..., Any], args: tuple[Any, ...], kwargs: dict[str, Any] = ...) -> None: ... def exit() -> NoReturn: ... def get_ident() -> int: ... def allocate_lock() -> LockType: ... diff --git a/stdlib/_dummy_threading.pyi b/stdlib/_dummy_threading.pyi index c956946c8363..583127500be8 100644 --- a/stdlib/_dummy_threading.pyi +++ b/stdlib/_dummy_threading.pyi @@ -60,7 +60,7 @@ class Thread: def __init__( self, group: None = ..., - target: Callable[..., object] | None = ..., + target: Callable[..., Any] | None = ..., name: str | None = ..., args: Iterable[Any] = ..., kwargs: Mapping[str, Any] | None = ..., @@ -151,7 +151,7 @@ class Timer(Thread): def __init__( self, interval: float, - function: Callable[..., object], + function: Callable[..., Any], args: Iterable[Any] | None = ..., kwargs: Mapping[str, Any] | None = ..., ) -> None: ... diff --git a/stdlib/_thread.pyi b/stdlib/_thread.pyi index 152362edcaea..10a191cbdf78 100644 --- a/stdlib/_thread.pyi +++ b/stdlib/_thread.pyi @@ -19,7 +19,7 @@ class LockType: self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... -def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any] = ...) -> int: ... +def start_new_thread(function: Callable[..., Any], args: tuple[Any, ...], kwargs: dict[str, Any] = ...) -> int: ... def interrupt_main() -> None: ... def exit() -> NoReturn: ... def allocate_lock() -> LockType: ... diff --git a/stdlib/_typeshed/__init__.pyi b/stdlib/_typeshed/__init__.pyi index 89ca9d81619a..307b80875874 100644 --- a/stdlib/_typeshed/__init__.pyi +++ b/stdlib/_typeshed/__init__.pyi @@ -271,7 +271,7 @@ AnyOrLiteralStr = TypeVar("AnyOrLiteralStr", str, bytes, LiteralString) # noqa: StrOrLiteralStr = TypeVar("StrOrLiteralStr", LiteralString, str) # noqa: Y001 # Objects suitable to be passed to sys.setprofile, threading.setprofile, and similar -ProfileFunction: TypeAlias = Callable[[FrameType, str, Any], object] +ProfileFunction: TypeAlias = Callable[[FrameType, str, Any], Any] # Objects suitable to be passed to sys.settrace, threading.settrace, and similar # TODO: Ideally this would be a recursive type alias diff --git a/stdlib/_typeshed/wsgi.pyi b/stdlib/_typeshed/wsgi.pyi index de731aea918b..3e91ff4782a2 100644 --- a/stdlib/_typeshed/wsgi.pyi +++ b/stdlib/_typeshed/wsgi.pyi @@ -21,7 +21,7 @@ else: class StartResponse(Protocol): def __call__( self, __status: str, __headers: list[tuple[str, str]], __exc_info: OptExcInfo | None = ... - ) -> Callable[[bytes], object]: ... + ) -> Callable[[bytes], Any]: ... WSGIEnvironment: TypeAlias = dict[str, Any] # stable WSGIApplication: TypeAlias = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] # stable diff --git a/stdlib/asyncio/base_events.pyi b/stdlib/asyncio/base_events.pyi index 8697bfe306c4..a5105b4f84c1 100644 --- a/stdlib/asyncio/base_events.pyi +++ b/stdlib/asyncio/base_events.pyi @@ -20,7 +20,7 @@ else: _T = TypeVar("_T") _ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol) _Context: TypeAlias = dict[str, Any] -_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], object] +_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], Any] _ProtocolFactory: TypeAlias = Callable[[], BaseProtocol] _SSLContext: TypeAlias = bool | None | ssl.SSLContext @@ -74,11 +74,11 @@ class BaseEventLoop(AbstractEventLoop): def close(self) -> None: ... async def shutdown_asyncgens(self) -> None: ... # Methods scheduling callbacks. All these return Handles. - def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ... def call_later( - self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = ... + self, delay: float, callback: Callable[..., Any], *args: Any, context: Context | None = ... ) -> TimerHandle: ... - def call_at(self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> TimerHandle: ... + def call_at(self, when: float, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> TimerHandle: ... def time(self) -> float: ... # Future methods def create_future(self) -> Future[Any]: ... @@ -95,7 +95,7 @@ class BaseEventLoop(AbstractEventLoop): def set_task_factory(self, factory: _TaskFactory | None) -> None: ... def get_task_factory(self) -> _TaskFactory | None: ... # Methods for interacting with threads - def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ... def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Future[_T]: ... def set_default_executor(self, executor: Any) -> None: ... # Network I/O methods returning Futures. diff --git a/stdlib/asyncio/base_subprocess.pyi b/stdlib/asyncio/base_subprocess.pyi index 44606b6d137c..963cfa93de28 100644 --- a/stdlib/asyncio/base_subprocess.pyi +++ b/stdlib/asyncio/base_subprocess.pyi @@ -56,7 +56,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport): def terminate(self) -> None: ... def kill(self) -> None: ... async def _connect_pipes(self, waiter: futures.Future[Any] | None) -> None: ... # undocumented - def _call(self, cb: Callable[..., object], *data: Any) -> None: ... # undocumented + def _call(self, cb: Callable[..., Any], *data: Any) -> None: ... # undocumented def _pipe_connection_lost(self, fd: int, exc: BaseException | None) -> None: ... # undocumented def _pipe_data_received(self, fd: int, data: bytes) -> None: ... # undocumented def _process_exited(self, returncode: int) -> None: ... # undocumented diff --git a/stdlib/asyncio/coroutines.pyi b/stdlib/asyncio/coroutines.pyi index 14fb627ae6fe..b6da90f62646 100644 --- a/stdlib/asyncio/coroutines.pyi +++ b/stdlib/asyncio/coroutines.pyi @@ -20,7 +20,7 @@ def iscoroutinefunction(func: Callable[..., Coroutine[Any, Any, Any]]) -> bool: @overload def iscoroutinefunction(func: Callable[_P, Awaitable[_T]]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, _T]]]: ... @overload -def iscoroutinefunction(func: Callable[_P, object]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, Any]]]: ... +def iscoroutinefunction(func: Callable[_P, Any]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, Any]]]: ... @overload def iscoroutinefunction(func: object) -> TypeGuard[Callable[..., Coroutine[Any, Any, Any]]]: ... diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index 0eeebbc3ab8f..659528fe1ea1 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -57,7 +57,7 @@ else: _T = TypeVar("_T") _ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol) _Context: TypeAlias = dict[str, Any] -_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], object] +_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], Any] _ProtocolFactory: TypeAlias = Callable[[], BaseProtocol] _SSLContext: TypeAlias = bool | None | ssl.SSLContext @@ -70,7 +70,7 @@ class Handle: _cancelled: bool _args: Sequence[Any] def __init__( - self, callback: Callable[..., object], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = ... + self, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = ... ) -> None: ... def cancel(self) -> None: ... def _run(self) -> None: ... @@ -80,7 +80,7 @@ class TimerHandle(Handle): def __init__( self, when: float, - callback: Callable[..., object], + callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = ..., @@ -133,22 +133,22 @@ class AbstractEventLoop: # Methods scheduling callbacks. All these return Handles. if sys.version_info >= (3, 9): # "context" added in 3.9.10/3.10.2 @abstractmethod - def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ... @abstractmethod def call_later( - self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = ... + self, delay: float, callback: Callable[..., Any], *args: Any, context: Context | None = ... ) -> TimerHandle: ... @abstractmethod def call_at( - self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = ... + self, when: float, callback: Callable[..., Any], *args: Any, context: Context | None = ... ) -> TimerHandle: ... else: @abstractmethod - def call_soon(self, callback: Callable[..., object], *args: Any) -> Handle: ... + def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ... @abstractmethod - def call_later(self, delay: float, callback: Callable[..., object], *args: Any) -> TimerHandle: ... + def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... @abstractmethod - def call_at(self, when: float, callback: Callable[..., object], *args: Any) -> TimerHandle: ... + def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... @abstractmethod def time(self) -> float: ... @@ -181,10 +181,10 @@ class AbstractEventLoop: # Methods for interacting with threads if sys.version_info >= (3, 9): # "context" added in 3.9.10/3.10.2 @abstractmethod - def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ... else: @abstractmethod - def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any) -> Handle: ... + def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ... @abstractmethod def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Future[_T]: ... @@ -577,7 +577,7 @@ class AbstractEventLoop: async def sock_sendto(self, sock: socket, data: bytes, address: _Address) -> None: ... # Signal handling. @abstractmethod - def add_signal_handler(self, sig: int, callback: Callable[..., object], *args: Any) -> None: ... + def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ... @abstractmethod def remove_signal_handler(self, sig: int) -> bool: ... # Error handlers. diff --git a/stdlib/asyncio/futures.pyi b/stdlib/asyncio/futures.pyi index f917bd5dee98..96b5cb925099 100644 --- a/stdlib/asyncio/futures.pyi +++ b/stdlib/asyncio/futures.pyi @@ -44,7 +44,7 @@ class Future(Awaitable[_T], Iterable[_T]): def get_loop(self) -> AbstractEventLoop: ... @property def _callbacks(self: Self) -> list[tuple[Callable[[Self], Any], Context]]: ... - def add_done_callback(self: Self, __fn: Callable[[Self], object], *, context: Context | None = ...) -> None: ... + def add_done_callback(self: Self, __fn: Callable[[Self], Any], *, context: Context | None = ...) -> None: ... if sys.version_info >= (3, 9): def cancel(self, msg: Any | None = ...) -> bool: ... else: @@ -54,7 +54,7 @@ class Future(Awaitable[_T], Iterable[_T]): def done(self) -> bool: ... def result(self) -> _T: ... def exception(self) -> BaseException | None: ... - def remove_done_callback(self: Self, __fn: Callable[[Self], object]) -> int: ... + def remove_done_callback(self: Self, __fn: Callable[[Self], Any]) -> int: ... def set_result(self, __result: _T) -> None: ... def set_exception(self, __exception: type | BaseException) -> None: ... def __iter__(self) -> Generator[Any, None, _T]: ... diff --git a/stdlib/asyncio/sslproto.pyi b/stdlib/asyncio/sslproto.pyi index 34414d649297..9cd66fc00391 100644 --- a/stdlib/asyncio/sslproto.pyi +++ b/stdlib/asyncio/sslproto.pyi @@ -57,8 +57,8 @@ if sys.version_info < (3, 11): def need_ssldata(self) -> bool: ... @property def wrapped(self) -> bool: ... - def do_handshake(self, callback: Callable[[BaseException | None], object] | None = ...) -> list[bytes]: ... - def shutdown(self, callback: Callable[[], object] | None = ...) -> list[bytes]: ... + def do_handshake(self, callback: Callable[[BaseException | None], Any] | None = ...) -> list[bytes]: ... + def shutdown(self, callback: Callable[[], Any] | None = ...) -> list[bytes]: ... def feed_eof(self) -> None: ... def feed_ssldata(self, data: bytes, only_handshake: bool = ...) -> tuple[list[bytes], list[bytes]]: ... def feed_appdata(self, data: bytes, offset: int = ...) -> tuple[list[bytes], int]: ... diff --git a/stdlib/asyncio/unix_events.pyi b/stdlib/asyncio/unix_events.pyi index 54e663ece192..26b2ffb716a9 100644 --- a/stdlib/asyncio/unix_events.pyi +++ b/stdlib/asyncio/unix_events.pyi @@ -14,7 +14,7 @@ from .selector_events import BaseSelectorEventLoop # So, it is special cased. class AbstractChildWatcher: @abstractmethod - def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... @abstractmethod def remove_child_handler(self, pid: int) -> bool: ... @abstractmethod @@ -67,13 +67,13 @@ if sys.platform != "win32": class SafeChildWatcher(BaseChildWatcher): def __enter__(self: Self) -> Self: ... def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ... - def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... class FastChildWatcher(BaseChildWatcher): def __enter__(self: Self) -> Self: ... def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ... - def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... class _UnixSelectorEventLoop(BaseSelectorEventLoop): ... @@ -102,7 +102,7 @@ if sys.platform != "win32": def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... - def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... @@ -115,7 +115,7 @@ if sys.platform != "win32": self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... def __del__(self, _warn: _Warn = ...) -> None: ... - def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... @@ -129,5 +129,5 @@ if sys.platform != "win32": def is_active(self) -> bool: ... def close(self) -> None: ... def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... - def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... diff --git a/stdlib/asyncio/windows_utils.pyi b/stdlib/asyncio/windows_utils.pyi index 6e170dcb073a..093a8cf1c686 100644 --- a/stdlib/asyncio/windows_utils.pyi +++ b/stdlib/asyncio/windows_utils.pyi @@ -30,7 +30,7 @@ if sys.platform == "win32": @property def handle(self) -> int: ... def fileno(self) -> int: ... - def close(self, *, CloseHandle: Callable[[int], object] = ...) -> None: ... + def close(self, *, CloseHandle: Callable[[int], Any] = ...) -> None: ... class Popen(subprocess.Popen[AnyStr]): stdin: PipeHandle | None # type: ignore[assignment] diff --git a/stdlib/atexit.pyi b/stdlib/atexit.pyi index ea041d7b5e46..f9d8e1d53050 100644 --- a/stdlib/atexit.pyi +++ b/stdlib/atexit.pyi @@ -9,4 +9,4 @@ def _clear() -> None: ... def _ncallbacks() -> int: ... def _run_exitfuncs() -> None: ... def register(func: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Callable[_P, _T]: ... -def unregister(func: Callable[..., object]) -> None: ... +def unregister(func: Callable[..., Any]) -> None: ... diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 1a88e708aecd..8b527b8958d4 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -177,7 +177,7 @@ class type: def __instancecheck__(self, __instance: Any) -> bool: ... def __subclasscheck__(self, __subclass: type) -> bool: ... @classmethod - def __prepare__(metacls, __name: str, __bases: tuple[type, ...], **kwds: Any) -> Mapping[str, object]: ... + def __prepare__(metacls, __name: str, __bases: tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ... if sys.version_info >= (3, 10): def __or__(self, __t: Any) -> types.UnionType: ... def __ror__(self, __t: Any) -> types.UnionType: ... @@ -1189,7 +1189,7 @@ def any(__iterable: Iterable[object]) -> bool: ... def ascii(__obj: object) -> str: ... def bin(__number: int | SupportsIndex) -> str: ... def breakpoint(*args: Any, **kws: Any) -> None: ... -def callable(__obj: object) -> TypeGuard[Callable[..., object]]: ... +def callable(__obj: object) -> TypeGuard[Callable[..., Any]]: ... def chr(__i: int) -> str: ... # We define this here instead of using os.PathLike to avoid import cycle issues. @@ -1243,10 +1243,10 @@ def divmod(__x: SupportsDivMod[_T_contra, _T_co], __y: _T_contra) -> _T_co: ... @overload def divmod(__x: _T_contra, __y: SupportsRDivMod[_T_contra, _T_co]) -> _T_co: ... -# The `globals` argument to `eval` has to be `dict[str, Any]` rather than `dict[str, object]` due to invariance. +# The `globals` argument to `eval` has to be `dict[str, Any]` rather than `dict[str, Any]` due to invariance. # (The `globals` argument has to be a "real dict", rather than any old mapping, unlike the `locals` argument.) def eval( - __source: str | ReadableBuffer | CodeType, __globals: dict[str, Any] | None = ..., __locals: Mapping[str, object] | None = ... + __source: str | ReadableBuffer | CodeType, __globals: dict[str, Any] | None = ..., __locals: Mapping[str, Any] | None = ... ) -> Any: ... # Comment above regarding `eval` applies to `exec` as well @@ -1254,7 +1254,7 @@ if sys.version_info >= (3, 11): def exec( __source: str | ReadableBuffer | CodeType, __globals: dict[str, Any] | None = ..., - __locals: Mapping[str, object] | None = ..., + __locals: Mapping[str, Any] | None = ..., *, closure: tuple[_Cell, ...] | None = ..., ) -> None: ... @@ -1263,7 +1263,7 @@ else: def exec( __source: str | ReadableBuffer | CodeType, __globals: dict[str, Any] | None = ..., - __locals: Mapping[str, object] | None = ..., + __locals: Mapping[str, Any] | None = ..., ) -> None: ... def exit(code: object = ...) -> NoReturn: ... @@ -1750,8 +1750,8 @@ class zip(Iterator[_T_co], Generic[_T_co]): # Return type of `__import__` should be kept the same as return type of `importlib.import_module` def __import__( name: str, - globals: Mapping[str, object] | None = ..., - locals: Mapping[str, object] | None = ..., + globals: Mapping[str, Any] | None = ..., + locals: Mapping[str, Any] | None = ..., fromlist: Sequence[str] = ..., level: int = ..., ) -> types.ModuleType: ... diff --git a/stdlib/concurrent/futures/_base.pyi b/stdlib/concurrent/futures/_base.pyi index 9dd9be4d647e..7a1e7e703fcd 100644 --- a/stdlib/concurrent/futures/_base.pyi +++ b/stdlib/concurrent/futures/_base.pyi @@ -49,7 +49,7 @@ class Future(Generic[_T]): def cancelled(self) -> bool: ... def running(self) -> bool: ... def done(self) -> bool: ... - def add_done_callback(self, fn: Callable[[Future[_T]], object]) -> None: ... + def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ... def result(self, timeout: float | None = ...) -> _T: ... def set_running_or_notify_cancel(self) -> bool: ... def set_result(self, result: _T) -> None: ... diff --git a/stdlib/concurrent/futures/process.pyi b/stdlib/concurrent/futures/process.pyi index 211107cf357d..cb4fdefc270d 100644 --- a/stdlib/concurrent/futures/process.pyi +++ b/stdlib/concurrent/futures/process.pyi @@ -110,7 +110,7 @@ if sys.version_info >= (3, 11): def _process_worker( call_queue: Queue[_CallItem], result_queue: SimpleQueue[_ResultItem], - initializer: Callable[..., object] | None, + initializer: Callable[..., Any] | None, initargs: tuple[Any, ...], max_tasks: int | None = ..., ) -> None: ... @@ -119,7 +119,7 @@ else: def _process_worker( call_queue: Queue[_CallItem], result_queue: SimpleQueue[_ResultItem], - initializer: Callable[..., object] | None, + initializer: Callable[..., Any] | None, initargs: tuple[Any, ...], ) -> None: ... @@ -174,7 +174,7 @@ class ProcessPoolExecutor(Executor): self, max_workers: int | None = ..., mp_context: BaseContext | None = ..., - initializer: Callable[..., object] | None = ..., + initializer: Callable[..., Any] | None = ..., initargs: tuple[Any, ...] = ..., *, max_tasks_per_child: int | None = ..., @@ -184,7 +184,7 @@ class ProcessPoolExecutor(Executor): self, max_workers: int | None = ..., mp_context: BaseContext | None = ..., - initializer: Callable[..., object] | None = ..., + initializer: Callable[..., Any] | None = ..., initargs: tuple[Any, ...] = ..., ) -> None: ... if sys.version_info >= (3, 9): diff --git a/stdlib/concurrent/futures/thread.pyi b/stdlib/concurrent/futures/thread.pyi index 387ce0d7e438..cc10ee7a31e2 100644 --- a/stdlib/concurrent/futures/thread.pyi +++ b/stdlib/concurrent/futures/thread.pyi @@ -29,10 +29,7 @@ class _WorkItem(Generic[_S]): def __class_getitem__(cls, item: Any) -> GenericAlias: ... def _worker( - executor_reference: ref[Any], - work_queue: queue.SimpleQueue[Any], - initializer: Callable[..., object], - initargs: tuple[Any, ...], + executor_reference: ref[Any], work_queue: queue.SimpleQueue[Any], initializer: Callable[..., Any], initargs: tuple[Any, ...] ) -> None: ... class BrokenThreadPool(BrokenExecutor): ... @@ -52,7 +49,7 @@ class ThreadPoolExecutor(Executor): self, max_workers: int | None = ..., thread_name_prefix: str = ..., - initializer: Callable[..., object] | None = ..., + initializer: Callable[..., Any] | None = ..., initargs: tuple[Any, ...] = ..., ) -> None: ... def _adjust_thread_count(self) -> None: ... diff --git a/stdlib/distutils/ccompiler.pyi b/stdlib/distutils/ccompiler.pyi index 5b92c5f5c42e..df5963be2828 100644 --- a/stdlib/distutils/ccompiler.pyi +++ b/stdlib/distutils/ccompiler.pyi @@ -143,7 +143,7 @@ class CCompiler: def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ... def object_filenames(self, source_filenames: list[str], strip_dir: int = ..., output_dir: str = ...) -> list[str]: ... def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... - def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ... + def execute(self, func: Callable[..., Any], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ... def spawn(self, cmd: list[str]) -> None: ... def mkpath(self, name: str, mode: int = ...) -> None: ... def move_file(self, src: str, dst: str) -> str: ... diff --git a/stdlib/distutils/cmd.pyi b/stdlib/distutils/cmd.pyi index e706bdbc5802..8163ae78fd8f 100644 --- a/stdlib/distutils/cmd.pyi +++ b/stdlib/distutils/cmd.pyi @@ -25,7 +25,7 @@ class Command: def run_command(self, command: str) -> None: ... def get_sub_commands(self) -> list[str]: ... def warn(self, msg: str) -> None: ... - def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ... + def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ... def mkpath(self, name: str, mode: int = ...) -> None: ... def copy_file( self, @@ -60,7 +60,7 @@ class Command: self, infiles: str | list[str] | tuple[str, ...], outfile: str, - func: Callable[..., object], + func: Callable[..., Any], args: list[Any], exec_msg: str | None = ..., skip_msg: str | None = ..., diff --git a/stdlib/distutils/util.pyi b/stdlib/distutils/util.pyi index da8d66063536..5c2f46c89151 100644 --- a/stdlib/distutils/util.pyi +++ b/stdlib/distutils/util.pyi @@ -10,7 +10,7 @@ def check_environ() -> None: ... def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... def split_quoted(s: str) -> list[str]: ... def execute( - func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ... + func: Callable[..., Any], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ... ) -> None: ... def strtobool(val: str) -> Literal[0, 1]: ... def byte_compile( diff --git a/stdlib/doctest.pyi b/stdlib/doctest.pyi index 6bb1bf9d33c5..c767436c2be8 100644 --- a/stdlib/doctest.pyi +++ b/stdlib/doctest.pyi @@ -126,7 +126,7 @@ class DocTestFinder: extraglobs: dict[str, Any] | None = ..., ) -> list[DocTest]: ... -_Out: TypeAlias = Callable[[str], object] +_Out: TypeAlias = Callable[[str], Any] class DocTestRunner: DIVIDER: str @@ -201,8 +201,8 @@ class DocTestCase(unittest.TestCase): self, test: DocTest, optionflags: int = ..., - setUp: Callable[[DocTest], object] | None = ..., - tearDown: Callable[[DocTest], object] | None = ..., + setUp: Callable[[DocTest], Any] | None = ..., + tearDown: Callable[[DocTest], Any] | None = ..., checker: OutputChecker | None = ..., ) -> None: ... def setUp(self) -> None: ... diff --git a/stdlib/email/mime/application.pyi b/stdlib/email/mime/application.pyi index dfff85265ade..e797e4d53456 100644 --- a/stdlib/email/mime/application.pyi +++ b/stdlib/email/mime/application.pyi @@ -10,7 +10,7 @@ class MIMEApplication(MIMENonMultipart): self, _data: str | bytes, _subtype: str = ..., - _encoder: Callable[[MIMEApplication], object] = ..., + _encoder: Callable[[MIMEApplication], Any] = ..., *, policy: Policy | None = ..., **_params: _ParamsType, diff --git a/stdlib/email/mime/audio.pyi b/stdlib/email/mime/audio.pyi index b355d55070ad..f4b28409c528 100644 --- a/stdlib/email/mime/audio.pyi +++ b/stdlib/email/mime/audio.pyi @@ -10,7 +10,7 @@ class MIMEAudio(MIMENonMultipart): self, _audiodata: str | bytes, _subtype: str | None = ..., - _encoder: Callable[[MIMEAudio], object] = ..., + _encoder: Callable[[MIMEAudio], Any] = ..., *, policy: Policy | None = ..., **_params: _ParamsType, diff --git a/stdlib/email/mime/image.pyi b/stdlib/email/mime/image.pyi index f575103de2d6..b2ae216af534 100644 --- a/stdlib/email/mime/image.pyi +++ b/stdlib/email/mime/image.pyi @@ -10,7 +10,7 @@ class MIMEImage(MIMENonMultipart): self, _imagedata: str | bytes, _subtype: str | None = ..., - _encoder: Callable[[MIMEImage], object] = ..., + _encoder: Callable[[MIMEImage], Any] = ..., *, policy: Policy | None = ..., **_params: _ParamsType, diff --git a/stdlib/ftplib.pyi b/stdlib/ftplib.pyi index 3d284c597019..960de135c0e8 100644 --- a/stdlib/ftplib.pyi +++ b/stdlib/ftplib.pyi @@ -90,22 +90,22 @@ class FTP: def ntransfercmd(self, cmd: str, rest: int | str | None = ...) -> tuple[socket, int]: ... def transfercmd(self, cmd: str, rest: int | str | None = ...) -> socket: ... def retrbinary( - self, cmd: str, callback: Callable[[bytes], object], blocksize: int = ..., rest: int | str | None = ... + self, cmd: str, callback: Callable[[bytes], Any], blocksize: int = ..., rest: int | str | None = ... ) -> str: ... def storbinary( self, cmd: str, fp: SupportsRead[bytes], blocksize: int = ..., - callback: Callable[[bytes], object] | None = ..., + callback: Callable[[bytes], Any] | None = ..., rest: int | str | None = ..., ) -> str: ... - def retrlines(self, cmd: str, callback: Callable[[str], object] | None = ...) -> str: ... - def storlines(self, cmd: str, fp: SupportsReadline[bytes], callback: Callable[[bytes], object] | None = ...) -> str: ... + def retrlines(self, cmd: str, callback: Callable[[str], Any] | None = ...) -> str: ... + def storlines(self, cmd: str, fp: SupportsReadline[bytes], callback: Callable[[bytes], Any] | None = ...) -> str: ... def acct(self, password: str) -> str: ... def nlst(self, *args: str) -> list[str]: ... # Technically only the last arg can be a Callable but ... - def dir(self, *args: str | Callable[[str], object]) -> None: ... + def dir(self, *args: str | Callable[[str], Any]) -> None: ... def mlsd(self, path: str = ..., facts: Iterable[str] = ...) -> Iterator[tuple[str, dict[str, str]]]: ... def rename(self, fromname: str, toname: str) -> str: ... def delete(self, filename: str) -> str: ... diff --git a/stdlib/functools.pyi b/stdlib/functools.pyi index 5c3f662c3dd5..3003ef061a84 100644 --- a/stdlib/functools.pyi +++ b/stdlib/functools.pyi @@ -28,7 +28,7 @@ if sys.version_info >= (3, 8): if sys.version_info >= (3, 9): __all__ += ["cache"] -_AnyCallable: TypeAlias = Callable[..., object] +_AnyCallable: TypeAlias = Callable[..., Any] _T = TypeVar("_T") _S = TypeVar("_S") diff --git a/stdlib/gc.pyi b/stdlib/gc.pyi index d24b7c1f4c7c..3518f176ffb1 100644 --- a/stdlib/gc.pyi +++ b/stdlib/gc.pyi @@ -9,7 +9,7 @@ DEBUG_SAVEALL: Literal[32] DEBUG_STATS: Literal[1] DEBUG_UNCOLLECTABLE: Literal[4] -_CallbackType: TypeAlias = Callable[[Literal["start", "stop"], dict[str, int]], object] +_CallbackType: TypeAlias = Callable[[Literal["start", "stop"], dict[str, int]], Any] callbacks: list[_CallbackType] garbage: list[Any] diff --git a/stdlib/inspect.pyi b/stdlib/inspect.pyi index 7f9667c6ebed..02fa19f1e368 100644 --- a/stdlib/inspect.pyi +++ b/stdlib/inspect.pyi @@ -188,7 +188,7 @@ if sys.version_info >= (3, 8): @overload def iscoroutinefunction(obj: Callable[_P, Awaitable[_T]]) -> TypeGuard[Callable[_P, CoroutineType[Any, Any, _T]]]: ... @overload - def iscoroutinefunction(obj: Callable[_P, object]) -> TypeGuard[Callable[_P, CoroutineType[Any, Any, Any]]]: ... + def iscoroutinefunction(obj: Callable[_P, Any]) -> TypeGuard[Callable[_P, CoroutineType[Any, Any, Any]]]: ... @overload def iscoroutinefunction(obj: object) -> TypeGuard[Callable[..., CoroutineType[Any, Any, Any]]]: ... @@ -335,7 +335,7 @@ class Signature: if sys.version_info >= (3, 10): def get_annotations( - obj: Callable[..., object] | type[Any] | ModuleType, + obj: Callable[..., Any] | type[Any] | ModuleType, *, globals: Mapping[str, Any] | None = ..., locals: Mapping[str, Any] | None = ..., diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index 7299ee8200db..f365ad570050 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -20,7 +20,7 @@ _T6 = TypeVar("_T6") _Step: TypeAlias = SupportsFloat | SupportsInt | SupportsIndex | SupportsComplex -_Predicate: TypeAlias = Callable[[_T], object] +_Predicate: TypeAlias = Callable[[_T], Any] # Technically count can take anything that implements a number protocol and has an add method # but we can't enforce the add method diff --git a/stdlib/lib2to3/pgen2/tokenize.pyi b/stdlib/lib2to3/pgen2/tokenize.pyi index c9ad1e7bb411..f71661c81508 100644 --- a/stdlib/lib2to3/pgen2/tokenize.pyi +++ b/stdlib/lib2to3/pgen2/tokenize.pyi @@ -75,7 +75,7 @@ __all__ = [ ] _Coord: TypeAlias = tuple[int, int] -_TokenEater: TypeAlias = Callable[[int, str, _Coord, _Coord, str], object] +_TokenEater: TypeAlias = Callable[[int, str, _Coord, _Coord, str], Any] _TokenInfo: TypeAlias = tuple[int, str, _Coord, _Coord, str] class TokenError(Exception): ... diff --git a/stdlib/multiprocessing/context.pyi b/stdlib/multiprocessing/context.pyi index 7215955da535..60df547e7335 100644 --- a/stdlib/multiprocessing/context.pyi +++ b/stdlib/multiprocessing/context.pyi @@ -47,7 +47,7 @@ class BaseContext: def Manager(self) -> SyncManager: ... def Pipe(self, duplex: bool = ...) -> tuple[_ConnectionBase, _ConnectionBase]: ... def Barrier( - self, parties: int, action: Callable[..., object] | None = ..., timeout: float | None = ... + self, parties: int, action: Callable[..., Any] | None = ..., timeout: float | None = ... ) -> synchronize.Barrier: ... def BoundedSemaphore(self, value: int = ...) -> synchronize.BoundedSemaphore: ... def Condition(self, lock: _LockLike | None = ...) -> synchronize.Condition: ... @@ -61,7 +61,7 @@ class BaseContext: def Pool( self, processes: int | None = ..., - initializer: Callable[..., object] | None = ..., + initializer: Callable[..., Any] | None = ..., initargs: Iterable[Any] = ..., maxtasksperchild: int | None = ..., ) -> _Pool: ... diff --git a/stdlib/multiprocessing/dummy/__init__.pyi b/stdlib/multiprocessing/dummy/__init__.pyi index 5d289c058e03..5a34cdd12a9f 100644 --- a/stdlib/multiprocessing/dummy/__init__.pyi +++ b/stdlib/multiprocessing/dummy/__init__.pyi @@ -48,7 +48,7 @@ class DummyProcess(threading.Thread): def __init__( self, group: Any = ..., - target: Callable[..., object] | None = ..., + target: Callable[..., Any] | None = ..., name: str | None = ..., args: Iterable[Any] = ..., kwargs: Mapping[str, Any] = ..., @@ -69,7 +69,7 @@ class Value: def Array(typecode: Any, sequence: Sequence[Any], lock: Any = ...) -> array.array[Any]: ... def Manager() -> Any: ... -def Pool(processes: int | None = ..., initializer: Callable[..., object] | None = ..., initargs: Iterable[Any] = ...) -> Any: ... +def Pool(processes: int | None = ..., initializer: Callable[..., Any] | None = ..., initargs: Iterable[Any] = ...) -> Any: ... def active_children() -> list[Any]: ... current_process = threading.current_thread diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index dfbcb395ef1a..13a52996bc4c 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -146,7 +146,7 @@ class BaseManager: def get_server(self) -> Server: ... def connect(self) -> None: ... - def start(self, initializer: Callable[..., object] | None = ..., initargs: Iterable[Any] = ...) -> None: ... + def start(self, initializer: Callable[..., Any] | None = ..., initargs: Iterable[Any] = ...) -> None: ... def shutdown(self) -> None: ... # only available after start() was called def join(self, timeout: float | None = ...) -> None: ... # undocumented @property @@ -155,7 +155,7 @@ class BaseManager: def register( cls, typeid: str, - callable: Callable[..., object] | None = ..., + callable: Callable[..., Any] | None = ..., proxytype: Any = ..., exposed: Sequence[str] | None = ..., method_to_typeid: Mapping[str, str] | None = ..., diff --git a/stdlib/multiprocessing/pool.pyi b/stdlib/multiprocessing/pool.pyi index 2b97e16f0525..44bd35468026 100644 --- a/stdlib/multiprocessing/pool.pyi +++ b/stdlib/multiprocessing/pool.pyi @@ -16,14 +16,14 @@ _T = TypeVar("_T") class ApplyResult(Generic[_T]): if sys.version_info >= (3, 8): def __init__( - self, pool: Pool, callback: Callable[[_T], object] | None, error_callback: Callable[[BaseException], object] | None + self, pool: Pool, callback: Callable[[_T], Any] | None, error_callback: Callable[[BaseException], Any] | None ) -> None: ... else: def __init__( self, cache: dict[int, ApplyResult[Any]], - callback: Callable[[_T], object] | None, - error_callback: Callable[[BaseException], object] | None, + callback: Callable[[_T], Any] | None, + error_callback: Callable[[BaseException], Any] | None, ) -> None: ... def get(self, timeout: float | None = ...) -> _T: ... @@ -43,8 +43,8 @@ class MapResult(ApplyResult[list[_T]]): pool: Pool, chunksize: int, length: int, - callback: Callable[[list[_T]], object] | None, - error_callback: Callable[[BaseException], object] | None, + callback: Callable[[list[_T]], Any] | None, + error_callback: Callable[[BaseException], Any] | None, ) -> None: ... else: def __init__( @@ -52,8 +52,8 @@ class MapResult(ApplyResult[list[_T]]): cache: dict[int, ApplyResult[Any]], chunksize: int, length: int, - callback: Callable[[list[_T]], object] | None, - error_callback: Callable[[BaseException], object] | None, + callback: Callable[[list[_T]], Any] | None, + error_callback: Callable[[BaseException], Any] | None, ) -> None: ... class IMapIterator(Iterator[_T]): @@ -72,7 +72,7 @@ class Pool: def __init__( self, processes: int | None = ..., - initializer: Callable[..., object] | None = ..., + initializer: Callable[..., Any] | None = ..., initargs: Iterable[Any] = ..., maxtasksperchild: int | None = ..., context: Any | None = ..., @@ -83,8 +83,8 @@ class Pool: func: Callable[..., _T], args: Iterable[Any] = ..., kwds: Mapping[str, Any] = ..., - callback: Callable[[_T], object] | None = ..., - error_callback: Callable[[BaseException], object] | None = ..., + callback: Callable[[_T], Any] | None = ..., + error_callback: Callable[[BaseException], Any] | None = ..., ) -> AsyncResult[_T]: ... def map(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = ...) -> list[_T]: ... def map_async( @@ -92,8 +92,8 @@ class Pool: func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = ..., - callback: Callable[[_T], object] | None = ..., - error_callback: Callable[[BaseException], object] | None = ..., + callback: Callable[[_T], Any] | None = ..., + error_callback: Callable[[BaseException], Any] | None = ..., ) -> MapResult[_T]: ... def imap(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = ...) -> IMapIterator[_T]: ... def imap_unordered( @@ -105,8 +105,8 @@ class Pool: func: Callable[..., _T], iterable: Iterable[Iterable[Any]], chunksize: int | None = ..., - callback: Callable[[_T], object] | None = ..., - error_callback: Callable[[BaseException], object] | None = ..., + callback: Callable[[_T], Any] | None = ..., + error_callback: Callable[[BaseException], Any] | None = ..., ) -> AsyncResult[list[_T]]: ... def close(self) -> None: ... def terminate(self) -> None: ... @@ -118,7 +118,7 @@ class Pool: class ThreadPool(Pool): def __init__( - self, processes: int | None = ..., initializer: Callable[..., object] | None = ..., initargs: Iterable[Any] = ... + self, processes: int | None = ..., initializer: Callable[..., Any] | None = ..., initargs: Iterable[Any] = ... ) -> None: ... # undocumented diff --git a/stdlib/multiprocessing/process.pyi b/stdlib/multiprocessing/process.pyi index 7c8422e391c2..7a77a46192d1 100644 --- a/stdlib/multiprocessing/process.pyi +++ b/stdlib/multiprocessing/process.pyi @@ -15,7 +15,7 @@ class BaseProcess: def __init__( self, group: None = ..., - target: Callable[..., object] | None = ..., + target: Callable[..., Any] | None = ..., name: str | None = ..., args: Iterable[Any] = ..., kwargs: Mapping[str, Any] = ..., diff --git a/stdlib/multiprocessing/synchronize.pyi b/stdlib/multiprocessing/synchronize.pyi index c89142f2cd3b..d96731bae4e2 100644 --- a/stdlib/multiprocessing/synchronize.pyi +++ b/stdlib/multiprocessing/synchronize.pyi @@ -11,7 +11,7 @@ _LockLike: TypeAlias = Lock | RLock class Barrier(threading.Barrier): def __init__( - self, parties: int, action: Callable[[], object] | None = ..., timeout: float | None = ..., *ctx: BaseContext + self, parties: int, action: Callable[[], Any] | None = ..., timeout: float | None = ..., *ctx: BaseContext ) -> None: ... class BoundedSemaphore(Semaphore): diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index e3d428555462..17654f4e4de9 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -213,8 +213,8 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): decodevalue: _EnvironCodeFunc[AnyStr], ) -> None: ... else: - putenv: Callable[[AnyStr, AnyStr], object] - unsetenv: Callable[[AnyStr, AnyStr], object] + putenv: Callable[[AnyStr, AnyStr], Any] + unsetenv: Callable[[AnyStr, AnyStr], Any] def __init__( self, data: MutableMapping[AnyStr, AnyStr], @@ -222,8 +222,8 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): decodekey: _EnvironCodeFunc[AnyStr], encodevalue: _EnvironCodeFunc[AnyStr], decodevalue: _EnvironCodeFunc[AnyStr], - putenv: Callable[[AnyStr, AnyStr], object], - unsetenv: Callable[[AnyStr, AnyStr], object], + putenv: Callable[[AnyStr, AnyStr], Any], + unsetenv: Callable[[AnyStr, AnyStr], Any], ) -> None: ... def setdefault(self, key: AnyStr, value: AnyStr) -> AnyStr: ... # type: ignore[override] @@ -754,7 +754,7 @@ def utime( follow_symlinks: bool = ..., ) -> None: ... -_OnError: TypeAlias = Callable[[OSError], object] +_OnError: TypeAlias = Callable[[OSError], Any] def walk( top: GenericPath[AnyStr], topdown: bool = ..., onerror: _OnError | None = ..., followlinks: bool = ... @@ -974,7 +974,7 @@ if sys.version_info >= (3, 8): if sys.platform == "win32": class _AddedDllDirectory: path: str | None - def __init__(self, path: str | None, cookie: _T, remove_dll_directory: Callable[[_T], object]) -> None: ... + def __init__(self, path: str | None, cookie: _T, remove_dll_directory: Callable[[_T], Any]) -> None: ... def close(self) -> None: ... def __enter__(self: Self) -> Self: ... def __exit__(self, *args: object) -> None: ... diff --git a/stdlib/pkgutil.pyi b/stdlib/pkgutil.pyi index f91ab78ff35d..e4fb523e1074 100644 --- a/stdlib/pkgutil.pyi +++ b/stdlib/pkgutil.pyi @@ -41,7 +41,7 @@ def iter_importers(fullname: str = ...) -> Iterator[MetaPathFinder | PathEntryFi def iter_modules(path: Iterable[str] | None = ..., prefix: str = ...) -> Iterator[ModuleInfo]: ... def read_code(stream: SupportsRead[bytes]) -> Any: ... # undocumented def walk_packages( - path: Iterable[str] | None = ..., prefix: str = ..., onerror: Callable[[str], object] | None = ... + path: Iterable[str] | None = ..., prefix: str = ..., onerror: Callable[[str], Any] | None = ... ) -> Iterator[ModuleInfo]: ... def get_data(package: str, resource: str) -> bytes | None: ... diff --git a/stdlib/pydoc.pyi b/stdlib/pydoc.pyi index abcffc31111a..5bb01aa0e54a 100644 --- a/stdlib/pydoc.pyi +++ b/stdlib/pydoc.pyi @@ -236,10 +236,10 @@ class ModuleScanner: quit: bool def run( self, - callback: Callable[[str | None, str, str], object], + callback: Callable[[str | None, str, str], Any], key: str | None = ..., - completer: Callable[[], object] | None = ..., - onerror: Callable[[str], object] | None = ..., + completer: Callable[[], Any] | None = ..., + onerror: Callable[[str], Any] | None = ..., ) -> None: ... def apropos(key: str) -> None: ... diff --git a/stdlib/readline.pyi b/stdlib/readline.pyi index ceca2e32f221..36631dc66cb6 100644 --- a/stdlib/readline.pyi +++ b/stdlib/readline.pyi @@ -24,8 +24,8 @@ if sys.platform != "win32": def replace_history_item(__pos: int, __line: str) -> None: ... def add_history(__string: str) -> None: ... def set_auto_history(__enabled: bool) -> None: ... - def set_startup_hook(__function: Callable[[], object] | None = ...) -> None: ... - def set_pre_input_hook(__function: Callable[[], object] | None = ...) -> None: ... + def set_startup_hook(__function: Callable[[], Any] | None = ...) -> None: ... + def set_pre_input_hook(__function: Callable[[], Any] | None = ...) -> None: ... def set_completer(__function: _Completer | None = ...) -> None: ... def get_completer() -> _Completer | None: ... def get_completion_type() -> int: ... diff --git a/stdlib/sched.pyi b/stdlib/sched.pyi index 29c84f951124..6dba29ec135e 100644 --- a/stdlib/sched.pyi +++ b/stdlib/sched.pyi @@ -26,9 +26,9 @@ else: class scheduler: timefunc: Callable[[], float] - delayfunc: Callable[[float], object] + delayfunc: Callable[[float], Any] - def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], object] = ...) -> None: ... + def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], Any] = ...) -> None: ... def enterabs( self, time: float, priority: Any, action: _ActionCallback, argument: tuple[Any, ...] = ..., kwargs: dict[str, Any] = ... ) -> Event: ... diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index 13c706de1cf4..bcf6e4a53546 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -67,7 +67,7 @@ if sys.version_info >= (3, 8): dst: StrPath, symlinks: bool = ..., ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = ..., - copy_function: Callable[[str, str], object] = ..., + copy_function: Callable[[str, str], Any] = ..., ignore_dangling_symlinks: bool = ..., dirs_exist_ok: bool = ..., ) -> _PathReturn: ... @@ -78,11 +78,11 @@ else: dst: StrPath, symlinks: bool = ..., ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = ..., - copy_function: Callable[[str, str], object] = ..., + copy_function: Callable[[str, str], Any] = ..., ignore_dangling_symlinks: bool = ..., ) -> _PathReturn: ... -_OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], Any, Any], object] +_OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], Any, Any], Any] if sys.version_info >= (3, 11): def rmtree( @@ -92,7 +92,7 @@ if sys.version_info >= (3, 11): else: def rmtree(path: StrOrBytesPath, ignore_errors: bool = ..., onerror: _OnErrorCallback | None = ...) -> None: ... -_CopyFn: TypeAlias = Callable[[str, str], object] | Callable[[StrPath, StrPath], object] +_CopyFn: TypeAlias = Callable[[str, str], Any] | Callable[[StrPath, StrPath], Any] # N.B. shutil.move appears to take bytes arguments, however, # this does not work when dst is (or is within) an existing directory. @@ -146,25 +146,21 @@ def make_archive( def get_archive_formats() -> list[tuple[str, str]]: ... @overload def register_archive_format( - name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = ... + name: str, function: Callable[..., Any], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = ... ) -> None: ... @overload def register_archive_format( - name: str, function: Callable[[str, str], object], extra_args: None = ..., description: str = ... + name: str, function: Callable[[str, str], Any], extra_args: None = ..., description: str = ... ) -> None: ... def unregister_archive_format(name: str) -> None: ... def unpack_archive(filename: StrPath, extract_dir: StrPath | None = ..., format: str | None = ...) -> None: ... @overload def register_unpack_format( - name: str, - extensions: list[str], - function: Callable[..., object], - extra_args: Sequence[tuple[str, Any]], - description: str = ..., + name: str, extensions: list[str], function: Callable[..., Any], extra_args: Sequence[tuple[str, Any]], description: str = ... ) -> None: ... @overload def register_unpack_format( - name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = ..., description: str = ... + name: str, extensions: list[str], function: Callable[[str, str], Any], extra_args: None = ..., description: str = ... ) -> None: ... def unregister_unpack_format(name: str) -> None: ... def get_unpack_formats() -> list[tuple[str, list[str], str]]: ... diff --git a/stdlib/sqlite3/dbapi2.pyi b/stdlib/sqlite3/dbapi2.pyi index 44595d5ae556..fae0273a062f 100644 --- a/stdlib/sqlite3/dbapi2.pyi +++ b/stdlib/sqlite3/dbapi2.pyi @@ -249,8 +249,8 @@ class _AnyParamWindowAggregateClass(Protocol): def finalize(self) -> _SqliteData: ... class _WindowAggregateClass(Protocol): - step: Callable[..., object] - inverse: Callable[..., object] + step: Callable[..., Any] + inverse: Callable[..., Any] def value(self) -> _SqliteData: ... def finalize(self) -> _SqliteData: ... @@ -338,7 +338,7 @@ class Connection: self, authorizer_callback: Callable[[int, str | None, str | None, str | None, str | None], int] | None ) -> None: ... def set_progress_handler(self, progress_handler: Callable[[], int | None] | None, n: int) -> None: ... - def set_trace_callback(self, trace_callback: Callable[[str], object] | None) -> None: ... + def set_trace_callback(self, trace_callback: Callable[[str], Any] | None) -> None: ... # enable_load_extension and load_extension is not available on python distributions compiled # without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1 def enable_load_extension(self, __enabled: bool) -> None: ... @@ -348,7 +348,7 @@ class Connection: target: Connection, *, pages: int = ..., - progress: Callable[[int, int, int], object] | None = ..., + progress: Callable[[int, int, int], Any] | None = ..., name: str = ..., sleep: float = ..., ) -> None: ... @@ -373,7 +373,7 @@ class Cursor(Iterator[Any]): def description(self) -> tuple[tuple[str, None, None, None, None, None, None], ...] | Any: ... @property def lastrowid(self) -> int | None: ... - row_factory: Callable[[Cursor, Row], object] | None + row_factory: Callable[[Cursor, Row], Any] | None @property def rowcount(self) -> int: ... def __init__(self, __cursor: Connection) -> None: ... diff --git a/stdlib/telnetlib.pyi b/stdlib/telnetlib.pyi index 67ae5fcc8055..5a4326c4a48b 100644 --- a/stdlib/telnetlib.pyi +++ b/stdlib/telnetlib.pyi @@ -104,7 +104,7 @@ class Telnet: def read_lazy(self) -> bytes: ... def read_very_lazy(self) -> bytes: ... def read_sb_data(self) -> bytes: ... - def set_option_negotiation_callback(self, callback: Callable[[socket.socket, bytes, bytes], object] | None) -> None: ... + def set_option_negotiation_callback(self, callback: Callable[[socket.socket, bytes, bytes], Any] | None) -> None: ... def process_rawq(self) -> None: ... def rawq_getchar(self) -> bytes: ... def fill_rawq(self) -> None: ... diff --git a/stdlib/threading.pyi b/stdlib/threading.pyi index 289a86826ecd..0b0961c05c99 100644 --- a/stdlib/threading.pyi +++ b/stdlib/threading.pyi @@ -75,7 +75,7 @@ class Thread: def __init__( self, group: None = ..., - target: Callable[..., object] | None = ..., + target: Callable[..., Any] | None = ..., name: str | None = ..., args: Iterable[Any] = ..., kwargs: Mapping[str, Any] | None = ..., @@ -171,7 +171,7 @@ class Timer(Thread): def __init__( self, interval: float, - function: Callable[..., object], + function: Callable[..., Any], args: Iterable[Any] | None = ..., kwargs: Mapping[str, Any] | None = ..., ) -> None: ... diff --git a/stdlib/timeit.pyi b/stdlib/timeit.pyi index dda6cefed0f6..076b2c54f991 100644 --- a/stdlib/timeit.pyi +++ b/stdlib/timeit.pyi @@ -5,7 +5,7 @@ from typing_extensions import TypeAlias __all__ = ["Timer", "timeit", "repeat", "default_timer"] _Timer: TypeAlias = Callable[[], float] -_Stmt: TypeAlias = str | Callable[[], object] +_Stmt: TypeAlias = str | Callable[[], Any] default_timer: _Timer @@ -16,7 +16,7 @@ class Timer: def print_exc(self, file: IO[str] | None = ...) -> None: ... def timeit(self, number: int = ...) -> float: ... def repeat(self, repeat: int = ..., number: int = ...) -> list[float]: ... - def autorange(self, callback: Callable[[int, float], object] | None = ...) -> tuple[int, float]: ... + def autorange(self, callback: Callable[[int, float], Any] | None = ...) -> tuple[int, float]: ... def timeit( stmt: _Stmt = ..., setup: _Stmt = ..., timer: _Timer = ..., number: int = ..., globals: dict[str, Any] | None = ... diff --git a/stdlib/turtle.pyi b/stdlib/turtle.pyi index 13197c336e5e..cdacaf63c41f 100644 --- a/stdlib/turtle.pyi +++ b/stdlib/turtle.pyi @@ -221,10 +221,10 @@ class TurtleScreen(TurtleScreenBase): def window_height(self) -> int: ... def getcanvas(self) -> Canvas: ... def getshapes(self) -> list[str]: ... - def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... - def onkey(self, fun: Callable[[], object], key: str) -> None: ... + def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ... + def onkey(self, fun: Callable[[], Any], key: str) -> None: ... def listen(self, xdummy: float | None = ..., ydummy: float | None = ...) -> None: ... - def ontimer(self, fun: Callable[[], object], t: int = ...) -> None: ... + def ontimer(self, fun: Callable[[], Any], t: int = ...) -> None: ... @overload def bgpic(self, picname: None = ...) -> str: ... @overload @@ -238,7 +238,7 @@ class TurtleScreen(TurtleScreenBase): resetscreen = reset clearscreen = clear addshape = register_shape - def onkeypress(self, fun: Callable[[], object], key: str | None = ...) -> None: ... + def onkeypress(self, fun: Callable[[], Any], key: str | None = ...) -> None: ... onkeyrelease = onkey class TNavigator: @@ -409,9 +409,9 @@ class RawTurtle(TPen, TNavigator): def getscreen(self) -> TurtleScreen: ... def getturtle(self: Self) -> Self: ... getpen = getturtle - def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... - def onrelease(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... - def ondrag(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... + def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ... + def onrelease(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ... + def ondrag(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ... def undo(self) -> None: ... turtlesize = shapesize @@ -490,10 +490,10 @@ def window_width() -> int: ... def window_height() -> int: ... def getcanvas() -> Canvas: ... def getshapes() -> list[str]: ... -def onclick(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... -def onkey(fun: Callable[[], object], key: str) -> None: ... +def onclick(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ... +def onkey(fun: Callable[[], Any], key: str) -> None: ... def listen(xdummy: float | None = ..., ydummy: float | None = ...) -> None: ... -def ontimer(fun: Callable[[], object], t: int = ...) -> None: ... +def ontimer(fun: Callable[[], Any], t: int = ...) -> None: ... @overload def bgpic(picname: None = ...) -> str: ... @overload @@ -508,7 +508,7 @@ resetscreen = reset clearscreen = clear addshape = register_shape -def onkeypress(fun: Callable[[], object], key: str | None = ...) -> None: ... +def onkeypress(fun: Callable[[], Any], key: str | None = ...) -> None: ... onkeyrelease = onkey @@ -680,8 +680,8 @@ def getturtle() -> Turtle: ... getpen = getturtle -def onrelease(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... -def ondrag(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... +def onrelease(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ... +def ondrag(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ... def undo() -> None: ... turtlesize = shapesize diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 1af4420e684d..853b1c561857 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -571,7 +571,7 @@ def new_class( name: str, bases: Iterable[object] = ..., kwds: dict[str, Any] | None = ..., - exec_body: Callable[[dict[str, Any]], object] | None = ..., + exec_body: Callable[[dict[str, Any]], Any] | None = ..., ) -> type: ... def resolve_bases(bases: Iterable[object]) -> tuple[Any, ...]: ... def prepare_class( @@ -581,7 +581,7 @@ def prepare_class( # Actually a different type, but `property` is special and we want that too. DynamicClassAttribute = property -_Fn = TypeVar("_Fn", bound=Callable[..., object]) +_Fn = TypeVar("_Fn", bound=Callable[..., Any]) _R = TypeVar("_R") _P = ParamSpec("_P") diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 980505271e66..608e195707d0 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -874,7 +874,7 @@ if sys.version_info >= (3, 11): def assert_never(__arg: Never) -> Never: ... def assert_type(__val: _T, __typ: Any) -> _T: ... def clear_overloads() -> None: ... - def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ... + def get_overloads(func: Callable[..., Any]) -> Sequence[Callable[..., Any]]: ... def dataclass_transform( *, eq_default: bool = ..., @@ -908,7 +908,7 @@ class NamedTuple(tuple[Any, ...]): def _replace(self: TypeshedSelf, **kwargs: Any) -> TypeshedSelf: ... # Internal mypy fallback type for all typed dicts (does not exist at runtime) -class _TypedDict(Mapping[str, object], metaclass=ABCMeta): +class _TypedDict(Mapping[str, Any], metaclass=ABCMeta): def copy(self: TypeshedSelf) -> TypeshedSelf: ... # Using NoReturn so that only calls using mypy plugin hook that specialize the signature # can go through. @@ -917,7 +917,7 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta): def pop(self, k: NoReturn, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] def update(self: _T, __m: _T) -> None: ... def __delitem__(self, k: NoReturn) -> None: ... - def items(self) -> ItemsView[str, object]: ... + def items(self) -> ItemsView[str, Any]: ... def keys(self) -> KeysView[str]: ... def values(self) -> ValuesView[object]: ... def __or__(self: TypeshedSelf, __value: TypeshedSelf) -> TypeshedSelf: ... diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index 0d82ec720c25..6b61e3bfde64 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -120,7 +120,7 @@ Literal: _SpecialForm def IntVar(name: str) -> Any: ... # returns a new TypeVar # Internal mypy fallback type for all typed dicts (does not exist at runtime) -class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): +class _TypedDict(Mapping[str, Any], metaclass=abc.ABCMeta): __required_keys__: frozenset[str] __optional_keys__: frozenset[str] __total__: bool @@ -131,7 +131,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. def pop(self, k: NoReturn, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] def update(self: _T, __m: _T) -> None: ... - def items(self) -> ItemsView[str, object]: ... + def items(self) -> ItemsView[str, Any]: ... def keys(self) -> KeysView[str]: ... def values(self) -> ValuesView[object]: ... def __delitem__(self, k: NoReturn) -> None: ... @@ -221,7 +221,7 @@ else: def assert_never(__arg: NoReturn) -> NoReturn: ... def assert_type(__val: _T, __typ: Any) -> _T: ... def clear_overloads() -> None: ... - def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ... + def get_overloads(func: Callable[..., Any]) -> Sequence[Callable[..., Any]]: ... Required: _SpecialForm NotRequired: _SpecialForm diff --git a/stdlib/unittest/case.pyi b/stdlib/unittest/case.pyi index 7db217077f1b..58d5e97f4bdb 100644 --- a/stdlib/unittest/case.pyi +++ b/stdlib/unittest/case.pyi @@ -65,7 +65,7 @@ else: ) -> bool | None: ... if sys.version_info >= (3, 8): - def addModuleCleanup(__function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addModuleCleanup(__function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... def doModuleCleanups() -> None: ... if sys.version_info >= (3, 11): @@ -156,7 +156,7 @@ class TestCase: self, expected_exception: type[BaseException] | tuple[type[BaseException], ...], expected_regex: str | bytes | Pattern[str] | Pattern[bytes], - callable: Callable[..., object], + callable: Callable[..., Any], *args: Any, **kwargs: Any, ) -> None: ... @@ -171,7 +171,7 @@ class TestCase: def assertWarns( # type: ignore[misc] self, expected_warning: type[Warning] | tuple[type[Warning], ...], - callable: Callable[_P, object], + callable: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs, ) -> None: ... @@ -182,7 +182,7 @@ class TestCase: self, expected_warning: type[Warning] | tuple[type[Warning], ...], expected_regex: str | bytes | Pattern[str] | Pattern[bytes], - callable: Callable[_P, object], + callable: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs, ) -> None: ... @@ -260,16 +260,16 @@ class TestCase: def assertListEqual(self, list1: list[Any], list2: list[Any], msg: Any = ...) -> None: ... def assertTupleEqual(self, tuple1: tuple[Any, ...], tuple2: tuple[Any, ...], msg: Any = ...) -> None: ... def assertSetEqual(self, set1: AbstractSet[object], set2: AbstractSet[object], msg: Any = ...) -> None: ... - def assertDictEqual(self, d1: Mapping[Any, object], d2: Mapping[Any, object], msg: Any = ...) -> None: ... + def assertDictEqual(self, d1: Mapping[Any, Any], d2: Mapping[Any, Any], msg: Any = ...) -> None: ... def fail(self, msg: Any = ...) -> NoReturn: ... def countTestCases(self) -> int: ... def defaultTestResult(self) -> unittest.result.TestResult: ... def id(self) -> str: ... def shortDescription(self) -> str | None: ... if sys.version_info >= (3, 8): - def addCleanup(self, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addCleanup(self, __function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... else: - def addCleanup(self, function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addCleanup(self, function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... if sys.version_info >= (3, 11): def enterContext(self, cm: AbstractContextManager[_T]) -> _T: ... @@ -277,7 +277,7 @@ class TestCase: def doCleanups(self) -> None: ... if sys.version_info >= (3, 8): @classmethod - def addClassCleanup(cls, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addClassCleanup(cls, __function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... @classmethod def doClassCleanups(cls) -> None: ... @@ -310,9 +310,9 @@ class TestCase: class FunctionTestCase(TestCase): def __init__( self, - testFunc: Callable[[], object], - setUp: Callable[[], object] | None = ..., - tearDown: Callable[[], object] | None = ..., + testFunc: Callable[[], Any], + setUp: Callable[[], Any] | None = ..., + tearDown: Callable[[], Any] | None = ..., description: str | None = ..., ) -> None: ... def runTest(self) -> None: ... diff --git a/stdlib/urllib/request.pyi b/stdlib/urllib/request.pyi index 0ad10a218680..27a89b1331d3 100644 --- a/stdlib/urllib/request.pyi +++ b/stdlib/urllib/request.pyi @@ -286,7 +286,7 @@ class HTTPErrorProcessor(BaseHandler): def urlretrieve( url: str, filename: StrOrBytesPath | None = ..., - reporthook: Callable[[int, int, int], object] | None = ..., + reporthook: Callable[[int, int, int], Any] | None = ..., data: _DataType = ..., ) -> tuple[str, HTTPMessage]: ... def urlcleanup() -> None: ... @@ -300,7 +300,7 @@ class URLopener: self, url: str, filename: str | None = ..., - reporthook: Callable[[int, int, int], object] | None = ..., + reporthook: Callable[[int, int, int], Any] | None = ..., data: bytes | None = ..., ) -> tuple[str, Message | None]: ... def addheader(self, *args: tuple[str, str]) -> None: ... # undocumented diff --git a/stdlib/urllib/response.pyi b/stdlib/urllib/response.pyi index 8c9a600f3c48..66b1cf82d1fd 100644 --- a/stdlib/urllib/response.pyi +++ b/stdlib/urllib/response.pyi @@ -37,9 +37,9 @@ class addbase(BinaryIO): def writelines(self, lines: Iterable[bytes]) -> None: ... class addclosehook(addbase): - closehook: Callable[..., object] + closehook: Callable[..., Any] hookargs: tuple[Any, ...] - def __init__(self, fp: IO[bytes], closehook: Callable[..., object], *hookargs: Any) -> None: ... + def __init__(self, fp: IO[bytes], closehook: Callable[..., Any], *hookargs: Any) -> None: ... class addinfo(addbase): headers: Message diff --git a/stdlib/weakref.pyi b/stdlib/weakref.pyi index af960391e85d..75a5b052a41b 100644 --- a/stdlib/weakref.pyi +++ b/stdlib/weakref.pyi @@ -42,7 +42,7 @@ _P = ParamSpec("_P") ProxyTypes: tuple[type[Any], ...] class WeakMethod(ref[_CallableT], Generic[_CallableT]): - def __new__(cls: type[Self], meth: _CallableT, callback: Callable[[_CallableT], object] | None = ...) -> Self: ... + def __new__(cls: type[Self], meth: _CallableT, callback: Callable[[_CallableT], Any] | None = ...) -> Self: ... def __call__(self) -> _CallableT | None: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... diff --git a/stdlib/wsgiref/types.pyi b/stdlib/wsgiref/types.pyi index 4e8f47264f3a..7ac58343a36c 100644 --- a/stdlib/wsgiref/types.pyi +++ b/stdlib/wsgiref/types.pyi @@ -8,7 +8,7 @@ __all__ = ["StartResponse", "WSGIEnvironment", "WSGIApplication", "InputStream", class StartResponse(Protocol): def __call__( self, __status: str, __headers: list[tuple[str, str]], __exc_info: _OptExcInfo | None = ... - ) -> Callable[[bytes], object]: ... + ) -> Callable[[bytes], Any]: ... WSGIEnvironment: TypeAlias = dict[str, Any] WSGIApplication: TypeAlias = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] diff --git a/stdlib/xdrlib.pyi b/stdlib/xdrlib.pyi index e0b8c6a54b00..59282c01a3db 100644 --- a/stdlib/xdrlib.pyi +++ b/stdlib/xdrlib.pyi @@ -29,9 +29,9 @@ class Packer: def pack_string(self, s: bytes) -> None: ... def pack_opaque(self, s: bytes) -> None: ... def pack_bytes(self, s: bytes) -> None: ... - def pack_list(self, list: Sequence[_T], pack_item: Callable[[_T], object]) -> None: ... - def pack_farray(self, n: int, list: Sequence[_T], pack_item: Callable[[_T], object]) -> None: ... - def pack_array(self, list: Sequence[_T], pack_item: Callable[[_T], object]) -> None: ... + def pack_list(self, list: Sequence[_T], pack_item: Callable[[_T], Any]) -> None: ... + def pack_farray(self, n: int, list: Sequence[_T], pack_item: Callable[[_T], Any]) -> None: ... + def pack_array(self, list: Sequence[_T], pack_item: Callable[[_T], Any]) -> None: ... class Unpacker: def __init__(self, data: bytes) -> None: ... diff --git a/stdlib/xml/etree/ElementTree.pyi b/stdlib/xml/etree/ElementTree.pyi index 84059bc21a87..82cd735bd829 100644 --- a/stdlib/xml/etree/ElementTree.pyi +++ b/stdlib/xml/etree/ElementTree.pyi @@ -325,7 +325,7 @@ if sys.version_info >= (3, 8): class C14NWriterTarget: def __init__( self, - write: Callable[[str], object], + write: Callable[[str], Any], *, with_comments: bool = ..., strip_text: bool = ..., diff --git a/stdlib/xmlrpc/client.pyi b/stdlib/xmlrpc/client.pyi index 7c0ba5c62fd7..c1370f74e06d 100644 --- a/stdlib/xmlrpc/client.pyi +++ b/stdlib/xmlrpc/client.pyi @@ -97,7 +97,7 @@ class ExpatParser: # undocumented def feed(self, data: str | bytes) -> None: ... def close(self) -> None: ... -_WriteCallback: TypeAlias = Callable[[str], object] +_WriteCallback: TypeAlias = Callable[[str], Any] class Marshaller: # TODO: Replace 'Any' with some kind of binding diff --git a/stubs/JACK-Client/jack/__init__.pyi b/stubs/JACK-Client/jack/__init__.pyi index 96b5b97b19f5..f6eb9c35f4ef 100644 --- a/stubs/JACK-Client/jack/__init__.pyi +++ b/stubs/JACK-Client/jack/__init__.pyi @@ -104,29 +104,29 @@ class Client: def transport_reposition_struct(self, position: _JackPositionT) -> None: ... # TODO def set_sync_timeout(self, timeout: int) -> None: ... def set_freewheel(self, onoff: bool) -> None: ... - def set_shutdown_callback(self, callback: Callable[[Status, str], object]) -> None: ... - def set_process_callback(self, callback: Callable[[int], object]) -> None: ... - def set_freewheel_callback(self, callback: Callable[[bool], object]) -> None: ... - def set_blocksize_callback(self, callback: Callable[[int], object]) -> None: ... - def set_samplerate_callback(self, callback: Callable[[int], object]) -> None: ... - def set_client_registration_callback(self, callback: Callable[[str, bool], object]) -> None: ... + def set_shutdown_callback(self, callback: Callable[[Status, str], Any]) -> None: ... + def set_process_callback(self, callback: Callable[[int], Any]) -> None: ... + def set_freewheel_callback(self, callback: Callable[[bool], Any]) -> None: ... + def set_blocksize_callback(self, callback: Callable[[int], Any]) -> None: ... + def set_samplerate_callback(self, callback: Callable[[int], Any]) -> None: ... + def set_client_registration_callback(self, callback: Callable[[str, bool], Any]) -> None: ... def set_port_registration_callback( - self, callback: Callable[[Port, bool], object] | None = ..., only_available: bool = ... + self, callback: Callable[[Port, bool], Any] | None = ..., only_available: bool = ... ) -> None: ... def set_port_connect_callback( - self, callback: Callable[[Port, Port, bool], object] | None = ..., only_available: bool = ... + self, callback: Callable[[Port, Port, bool], Any] | None = ..., only_available: bool = ... ) -> None: ... def set_port_rename_callback( - self, callback: Callable[[Port, str, str], object] | None = ..., only_available: bool = ... + self, callback: Callable[[Port, str, str], Any] | None = ..., only_available: bool = ... ) -> None: ... - def set_graph_order_callback(self, callback: Callable[[], object]) -> None: ... - def set_xrun_callback(self, callback: Callable[[float], object]) -> None: ... - def set_sync_callback(self, callback: Callable[[int, _JackPositionT], object] | None) -> None: ... + def set_graph_order_callback(self, callback: Callable[[], Any]) -> None: ... + def set_xrun_callback(self, callback: Callable[[float], Any]) -> None: ... + def set_sync_callback(self, callback: Callable[[int, _JackPositionT], Any] | None) -> None: ... def release_timebase(self) -> None: ... def set_timebase_callback( - self, callback: Callable[[int, int, _JackPositionT, bool], object] | None = ..., conditional: bool = ... + self, callback: Callable[[int, int, _JackPositionT, bool], Any] | None = ..., conditional: bool = ... ) -> bool: ... - def set_property_change_callback(self, callback: Callable[[int, str, int], object]) -> None: ... + def set_property_change_callback(self, callback: Callable[[int, str, int], Any]) -> None: ... def get_uuid_for_client_name(self, name: str) -> str: ... def get_client_name_by_uuid(self, uuid: str) -> str: ... def get_port_by_name(self, name: str) -> Port: ... @@ -282,6 +282,6 @@ def version() -> tuple[int, int, int, int]: ... def version_string() -> str: ... def client_name_size() -> int: ... def port_name_size() -> int: ... -def set_error_function(callback: Callable[[str], object] | None = ...) -> None: ... -def set_info_function(callback: Callable[[str], object] | None = ...) -> None: ... +def set_error_function(callback: Callable[[str], Any] | None = ...) -> None: ... +def set_info_function(callback: Callable[[str], Any] | None = ...) -> None: ... def client_pid(name: str) -> int: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi index 4e962d1eab58..4612073a1d01 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi @@ -46,8 +46,8 @@ class Dialect: @abstractmethod def create_connect_args(self, url: URL) -> None: ... def initialize(self, connection) -> None: ... - def on_connect_url(self, url) -> Callable[[DBAPIConnection], object] | None: ... - def on_connect(self) -> Callable[[DBAPIConnection], object] | None: ... + def on_connect_url(self, url) -> Callable[[DBAPIConnection], Any] | None: ... + def on_connect(self) -> Callable[[DBAPIConnection], Any] | None: ... # The following methods all raise NotImplementedError, but not all # dialects implement all methods, which is why they can't be marked # as abstract. diff --git a/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi b/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi index 7cfbf5b172eb..be2b49b62f60 100644 --- a/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi +++ b/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi @@ -77,7 +77,7 @@ class AWSXRayRecorder: kwargs: dict[str, Any], name: str, namespace: str, - meta_processor: Callable[..., object], + meta_processor: Callable[..., Any], ) -> Any: ... @property def enabled(self) -> bool: ... diff --git a/stubs/boto/boto/s3/key.pyi b/stubs/boto/boto/s3/key.pyi index 539f071b102f..92be358b985e 100644 --- a/stubs/boto/boto/s3/key.pyi +++ b/stubs/boto/boto/s3/key.pyi @@ -108,7 +108,7 @@ class Key: self, fp, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], object] | None = ..., + cb: Callable[[int, int], Any] | None = ..., num_cb: int = ..., query_args: Any | None = ..., chunked_transfer: bool = ..., @@ -121,7 +121,7 @@ class Key: fp, headers: dict[str, str] | None = ..., replace: bool = ..., - cb: Callable[[int, int], object] | None = ..., + cb: Callable[[int, int], Any] | None = ..., num_cb: int = ..., policy: Any | None = ..., reduced_redundancy: bool = ..., @@ -133,7 +133,7 @@ class Key: fp, headers: dict[str, str] | None = ..., replace: bool = ..., - cb: Callable[[int, int], object] | None = ..., + cb: Callable[[int, int], Any] | None = ..., num_cb: int = ..., policy: Any | None = ..., md5: Any | None = ..., @@ -148,7 +148,7 @@ class Key: filename, headers: dict[str, str] | None = ..., replace: bool = ..., - cb: Callable[[int, int], object] | None = ..., + cb: Callable[[int, int], Any] | None = ..., num_cb: int = ..., policy: Any | None = ..., md5: Any | None = ..., @@ -160,7 +160,7 @@ class Key: string_data: str | bytes, headers: dict[str, str] | None = ..., replace: bool = ..., - cb: Callable[[int, int], object] | None = ..., + cb: Callable[[int, int], Any] | None = ..., num_cb: int = ..., policy: Any | None = ..., md5: Any | None = ..., @@ -171,7 +171,7 @@ class Key: self, fp, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], object] | None = ..., + cb: Callable[[int, int], Any] | None = ..., num_cb: int = ..., torrent: bool = ..., version_id: Any | None = ..., @@ -179,13 +179,13 @@ class Key: response_headers: dict[str, str] | None = ..., ): ... def get_torrent_file( - self, fp, headers: dict[str, str] | None = ..., cb: Callable[[int, int], object] | None = ..., num_cb: int = ... + self, fp, headers: dict[str, str] | None = ..., cb: Callable[[int, int], Any] | None = ..., num_cb: int = ... ): ... def get_contents_to_file( self, fp, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], object] | None = ..., + cb: Callable[[int, int], Any] | None = ..., num_cb: int = ..., torrent: bool = ..., version_id: Any | None = ..., @@ -196,7 +196,7 @@ class Key: self, filename, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], object] | None = ..., + cb: Callable[[int, int], Any] | None = ..., num_cb: int = ..., torrent: bool = ..., version_id: Any | None = ..., @@ -207,7 +207,7 @@ class Key: def get_contents_as_string( self, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], object] | None = ..., + cb: Callable[[int, int], Any] | None = ..., num_cb: int = ..., torrent: bool = ..., version_id: Any | None = ..., @@ -218,7 +218,7 @@ class Key: def get_contents_as_string( self, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], object] | None = ..., + cb: Callable[[int, int], Any] | None = ..., num_cb: int = ..., torrent: bool = ..., version_id: Any | None = ..., diff --git a/stubs/fpdf2/fpdf/fpdf.pyi b/stubs/fpdf2/fpdf/fpdf.pyi index 2c7569bb686f..891f51e74fbd 100644 --- a/stubs/fpdf2/fpdf/fpdf.pyi +++ b/stubs/fpdf2/fpdf/fpdf.pyi @@ -59,7 +59,7 @@ class TitleStyle(NamedTuple): b_margin: int | None = ... class ToCPlaceholder(NamedTuple): - render_function: Callable[[FPDF, Any], object] + render_function: Callable[[FPDF, Any], Any] start_page: int y: int pages: int = ... diff --git a/stubs/gdb/gdb/__init__.pyi b/stubs/gdb/gdb/__init__.pyi index 7c31ee7abc1e..1e9f456f354e 100644 --- a/stubs/gdb/gdb/__init__.pyi +++ b/stubs/gdb/gdb/__init__.pyi @@ -31,7 +31,7 @@ def convenience_variable(__name: str) -> Value | None: ... def set_convenience_variable(__name: str, __value: _ValueOrNative | None) -> None: ... def parse_and_eval(__expression: str) -> Value: ... def find_pc_line(pc: int | Value) -> Symtab_and_line: ... -def post_event(__event: Callable[[], object]) -> None: ... +def post_event(__event: Callable[[], Any]) -> None: ... def write(string: str, stream: int = ...) -> None: ... def flush(stream: int = ...) -> None: ... def target_charset() -> str: ... @@ -357,7 +357,7 @@ class MICommand: installed: bool def __init__(self, name: str) -> None: ... - def invoke(self, arguments: list[str]) -> dict[str, object] | None: ... + def invoke(self, arguments: list[str]) -> dict[str, Any] | None: ... # Parameters @@ -641,7 +641,7 @@ class LazyString: class Architecture: def name(self) -> str: ... - def disassemble(self, start_pc: int, end_pc: int = ..., count: int = ...) -> list[dict[str, object]]: ... + def disassemble(self, start_pc: int, end_pc: int = ..., count: int = ...) -> list[dict[str, Any]]: ... def integer_type(self, size: int, signed: bool = ...) -> Type: ... def registers(self, reggroup: str = ...) -> RegisterDescriptorIterator: ... def register_groups(self) -> RegisterGroupsIterator: ... diff --git a/stubs/gdb/gdb/events.pyi b/stubs/gdb/gdb/events.pyi index 72d4fc503389..92d0f150dcc2 100644 --- a/stubs/gdb/gdb/events.pyi +++ b/stubs/gdb/gdb/events.pyi @@ -8,8 +8,8 @@ class ThreadEvent: class ContinueEvent(ThreadEvent): ... class ContinueEventRegistry: - def connect(self, __object: Callable[[ContinueEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[ContinueEvent], object]) -> None: ... + def connect(self, __object: Callable[[ContinueEvent], Any]) -> None: ... + def disconnect(self, __object: Callable[[ContinueEvent], Any]) -> None: ... cont: ContinueEventRegistry @@ -18,8 +18,8 @@ class ExitedEvent: inferior: gdb.Inferior class ExitedEventRegistry: - def connect(self, __object: Callable[[ExitedEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[ExitedEvent], object]) -> None: ... + def connect(self, __object: Callable[[ExitedEvent], Any]) -> None: ... + def disconnect(self, __object: Callable[[ExitedEvent], Any]) -> None: ... exited: ExitedEventRegistry @@ -31,8 +31,8 @@ class BreakpointEvent(StopEvent): breakpoint: gdb.Breakpoint class StopEventRegistry: - def connect(self, __object: Callable[[StopEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[StopEvent], object]) -> None: ... + def connect(self, __object: Callable[[StopEvent], Any]) -> None: ... + def disconnect(self, __object: Callable[[StopEvent], Any]) -> None: ... stop: StopEventRegistry @@ -40,8 +40,8 @@ class NewObjFileEvent: new_objfile: gdb.Objfile class NewObjFileEventRegistry: - def connect(self, __object: Callable[[NewObjFileEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[NewObjFileEvent], object]) -> None: ... + def connect(self, __object: Callable[[NewObjFileEvent], Any]) -> None: ... + def disconnect(self, __object: Callable[[NewObjFileEvent], Any]) -> None: ... new_objfile: NewObjFileEventRegistry @@ -49,8 +49,8 @@ class ClearObjFilesEvent: progspace: gdb.Progspace class ClearObjFilesEventRegistry: - def connect(self, __object: Callable[[ClearObjFilesEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[ClearObjFilesEvent], object]) -> None: ... + def connect(self, __object: Callable[[ClearObjFilesEvent], Any]) -> None: ... + def disconnect(self, __object: Callable[[ClearObjFilesEvent], Any]) -> None: ... clear_objfiles: ClearObjFilesEventRegistry @@ -65,8 +65,8 @@ class InferiorCallPostEvent(InferiorCallEvent): address: gdb.Value class InferiorCallEventRegistry: - def connect(self, __object: Callable[[InferiorCallEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[InferiorCallEvent], object]) -> None: ... + def connect(self, __object: Callable[[InferiorCallEvent], Any]) -> None: ... + def disconnect(self, __object: Callable[[InferiorCallEvent], Any]) -> None: ... inferior_call: InferiorCallEventRegistry @@ -75,8 +75,8 @@ class MemoryChangedEvent: length: int class MemoryChangedEventRegistry: - def connect(self, __object: Callable[[MemoryChangedEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[MemoryChangedEvent], object]) -> None: ... + def connect(self, __object: Callable[[MemoryChangedEvent], Any]) -> None: ... + def disconnect(self, __object: Callable[[MemoryChangedEvent], Any]) -> None: ... memory_changed: MemoryChangedEventRegistry @@ -85,22 +85,22 @@ class RegisterChangedEvent: regnum: str class RegisterChangedEventRegistry: - def connect(self, __object: Callable[[RegisterChangedEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[RegisterChangedEvent], object]) -> None: ... + def connect(self, __object: Callable[[RegisterChangedEvent], Any]) -> None: ... + def disconnect(self, __object: Callable[[RegisterChangedEvent], Any]) -> None: ... register_changed: RegisterChangedEventRegistry class BreakpointEventRegistry: - def connect(self, __object: Callable[[gdb.Breakpoint], object]) -> None: ... - def disconnect(self, __object: Callable[[gdb.Breakpoint], object]) -> None: ... + def connect(self, __object: Callable[[gdb.Breakpoint], Any]) -> None: ... + def disconnect(self, __object: Callable[[gdb.Breakpoint], Any]) -> None: ... breakpoint_created: BreakpointEventRegistry breakpoint_modified: BreakpointEventRegistry breakpoint_deleted: BreakpointEventRegistry class BeforePromptEventRegistry: - def connect(self, __object: Callable[[], object]) -> None: ... - def disconnect(self, __object: Callable[[], object]) -> None: ... + def connect(self, __object: Callable[[], Any]) -> None: ... + def disconnect(self, __object: Callable[[], Any]) -> None: ... before_prompt: BeforePromptEventRegistry @@ -108,8 +108,8 @@ class NewInferiorEvent: inferior: gdb.Inferior class NewInferiorEventRegistry: - def connect(self, __object: Callable[[NewInferiorEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[NewInferiorEvent], object]) -> None: ... + def connect(self, __object: Callable[[NewInferiorEvent], Any]) -> None: ... + def disconnect(self, __object: Callable[[NewInferiorEvent], Any]) -> None: ... new_inferior: NewInferiorEventRegistry @@ -117,15 +117,15 @@ class InferiorDeletedEvent: inferior: gdb.Inferior class InferiorDeletedEventRegistry: - def connect(self, __object: Callable[[InferiorDeletedEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[InferiorDeletedEvent], object]) -> None: ... + def connect(self, __object: Callable[[InferiorDeletedEvent], Any]) -> None: ... + def disconnect(self, __object: Callable[[InferiorDeletedEvent], Any]) -> None: ... inferior_deleted: InferiorDeletedEventRegistry class NewThreadEvent(ThreadEvent): ... class NewThreadEventRegistry: - def connect(self, __object: Callable[[NewThreadEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[NewThreadEvent], object]) -> None: ... + def connect(self, __object: Callable[[NewThreadEvent], Any]) -> None: ... + def disconnect(self, __object: Callable[[NewThreadEvent], Any]) -> None: ... new_thread: NewThreadEventRegistry diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi index 2f77041315cb..e5081b04fdec 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi @@ -80,7 +80,7 @@ class Property(ModelAttribute): required: bool | None = ..., default: object | None = ..., choices: Iterable[object] | None = ..., - validator: Callable[[Property, Any], object] | None = ..., + validator: Callable[[Property, Any], Any] | None = ..., verbose_name: str | None = ..., write_empty_list: bool | None = ..., ) -> None: ... @@ -125,7 +125,7 @@ class BlobProperty(Property): required: bool | None = ..., default: bytes | None = ..., choices: Iterable[bytes] | None = ..., - validator: Callable[[Property, Any], object] | None = ..., + validator: Callable[[Property, Any], Any] | None = ..., verbose_name: str | None = ..., write_empty_list: bool | None = ..., ) -> None: ... @@ -156,7 +156,7 @@ class JsonProperty(BlobProperty): required: bool | None = ..., default: object | None = ..., choices: Iterable[object] | None = ..., - validator: Callable[[Property, Any], object] | None = ..., + validator: Callable[[Property, Any], Any] | None = ..., verbose_name: str | None = ..., write_empty_list: bool | None = ..., ) -> None: ... @@ -182,7 +182,7 @@ class UserProperty(Property): required: bool | None = ..., default: bytes | None = ..., choices: Iterable[bytes] | None = ..., - validator: Callable[[Property, Any], object] | None = ..., + validator: Callable[[Property, Any], Any] | None = ..., verbose_name: str | None = ..., write_empty_list: bool | None = ..., ) -> None: ... @@ -216,7 +216,7 @@ class DateTimeProperty(Property): required: bool | None = ..., default: datetime.datetime | None = ..., choices: Iterable[datetime.datetime] | None = ..., - validator: Callable[[Property, Any], object] | None = ..., + validator: Callable[[Property, Any], Any] | None = ..., verbose_name: str | None = ..., write_empty_list: bool | None = ..., ) -> None: ... @@ -238,7 +238,7 @@ class GenericProperty(Property): class ComputedProperty(GenericProperty): def __init__( self, - func: Callable[[Model], object], + func: Callable[[Model], Any], name: str | None = ..., indexed: bool | None = ..., repeated: bool | None = ..., @@ -399,8 +399,8 @@ class Model(_NotEqualMixin, metaclass=MetaModel): def has_complete_key(self) -> bool: ... def to_dict( self, - include: list[object] | tuple[object, object] | set[object] | None = ..., - exclude: list[object] | tuple[object, object] | set[object] | None = ..., + include: list[object] | tuple[object, Any] | set[object] | None = ..., + exclude: list[object] | tuple[object, Any] | set[object] | None = ..., ): ... class Expando(Model): diff --git a/stubs/invoke/invoke/util.pyi b/stubs/invoke/invoke/util.pyi index d010b60300cc..7b08fef8e188 100644 --- a/stubs/invoke/invoke/util.pyi +++ b/stubs/invoke/invoke/util.pyi @@ -16,14 +16,14 @@ def cd(where: str) -> AbstractContextManager[None]: ... def has_fileno(stream) -> bool: ... def isatty(stream) -> bool: ... def encode_output(string: str, encoding: str) -> str: ... -def helpline(obj: Callable[..., object]) -> str | None: ... +def helpline(obj: Callable[..., Any]) -> str | None: ... class ExceptionHandlingThread(threading.Thread): def __init__( self, *, group: None = ..., - target: Callable[..., object] | None = ..., + target: Callable[..., Any] | None = ..., name: str | None = ..., args: Iterable[Any] = ..., kwargs: Mapping[str, Any] | None = ..., diff --git a/stubs/opentracing/opentracing/harness/scope_check.pyi b/stubs/opentracing/opentracing/harness/scope_check.pyi index 10b5ce11d39e..c03595c563c5 100644 --- a/stubs/opentracing/opentracing/harness/scope_check.pyi +++ b/stubs/opentracing/opentracing/harness/scope_check.pyi @@ -4,7 +4,7 @@ from ..scope_manager import ScopeManager class ScopeCompatibilityCheckMixin: def scope_manager(self) -> ScopeManager: ... - def run_test(self, test_fn: Callable[[], object]) -> None: ... + def run_test(self, test_fn: Callable[[], Any]) -> None: ... def test_missing_active_external(self) -> None: ... def test_missing_active(self) -> None: ... def test_activate(self) -> None: ... diff --git a/stubs/paramiko/paramiko/channel.pyi b/stubs/paramiko/paramiko/channel.pyi index f88d5c753e3e..46d8cbc3e624 100644 --- a/stubs/paramiko/paramiko/channel.pyi +++ b/stubs/paramiko/paramiko/channel.pyi @@ -60,9 +60,9 @@ class Channel(ClosingContextManager): auth_protocol: str | bytes | None = ..., auth_cookie: str | bytes | None = ..., single_connection: bool = ..., - handler: Callable[[Channel, tuple[str, int]], object] | None = ..., + handler: Callable[[Channel, tuple[str, int]], Any] | None = ..., ) -> bytes: ... - def request_forward_agent(self, handler: Callable[[Channel], object]) -> bool: ... + def request_forward_agent(self, handler: Callable[[Channel], Any]) -> bool: ... def get_transport(self) -> Transport: ... def set_name(self, name: str) -> None: ... def get_name(self) -> str: ... diff --git a/stubs/paramiko/paramiko/dsskey.pyi b/stubs/paramiko/paramiko/dsskey.pyi index f98c69f5191e..05f95eef58f6 100644 --- a/stubs/paramiko/paramiko/dsskey.pyi +++ b/stubs/paramiko/paramiko/dsskey.pyi @@ -31,4 +31,4 @@ class DSSKey(PKey): def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ... def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ... @staticmethod - def generate(bits: int = ..., progress_func: Callable[..., object] | None = ...) -> DSSKey: ... + def generate(bits: int = ..., progress_func: Callable[..., Any] | None = ...) -> DSSKey: ... diff --git a/stubs/paramiko/paramiko/ecdsakey.pyi b/stubs/paramiko/paramiko/ecdsakey.pyi index e5ff63c6b9ca..7eae8ef2219d 100644 --- a/stubs/paramiko/paramiko/ecdsakey.pyi +++ b/stubs/paramiko/paramiko/ecdsakey.pyi @@ -50,5 +50,5 @@ class ECDSAKey(PKey): def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ... @classmethod def generate( - cls, curve: EllipticCurve = ..., progress_func: Callable[..., object] | None = ..., bits: int | None = ... + cls, curve: EllipticCurve = ..., progress_func: Callable[..., Any] | None = ..., bits: int | None = ... ) -> ECDSAKey: ... diff --git a/stubs/paramiko/paramiko/packet.pyi b/stubs/paramiko/paramiko/packet.pyi index f7e62d8536a2..2396c458d789 100644 --- a/stubs/paramiko/paramiko/packet.pyi +++ b/stubs/paramiko/paramiko/packet.pyi @@ -44,7 +44,7 @@ class Packetizer: def get_mac_size_in(self) -> int: ... def get_mac_size_out(self) -> int: ... def need_rekey(self) -> bool: ... - def set_keepalive(self, interval: int, callback: Callable[[], object]) -> None: ... + def set_keepalive(self, interval: int, callback: Callable[[], Any]) -> None: ... def read_timer(self) -> None: ... def start_handshake(self, timeout: float) -> None: ... def handshake_timed_out(self) -> bool: ... diff --git a/stubs/paramiko/paramiko/rsakey.pyi b/stubs/paramiko/paramiko/rsakey.pyi index 477ac328ab77..b1c185b117cf 100644 --- a/stubs/paramiko/paramiko/rsakey.pyi +++ b/stubs/paramiko/paramiko/rsakey.pyi @@ -31,4 +31,4 @@ class RSAKey(PKey): def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ... def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ... @staticmethod - def generate(bits: int, progress_func: Callable[..., object] | None = ...) -> RSAKey: ... + def generate(bits: int, progress_func: Callable[..., Any] | None = ...) -> RSAKey: ... diff --git a/stubs/paramiko/paramiko/sftp_client.pyi b/stubs/paramiko/paramiko/sftp_client.pyi index ebaa92cb7ca4..83b089225a5d 100644 --- a/stubs/paramiko/paramiko/sftp_client.pyi +++ b/stubs/paramiko/paramiko/sftp_client.pyi @@ -11,7 +11,7 @@ from paramiko.sftp_file import SFTPFile from paramiko.transport import Transport from paramiko.util import ClosingContextManager -_Callback: TypeAlias = Callable[[int, int], object] +_Callback: TypeAlias = Callable[[int, int], Any] b_slash: bytes diff --git a/stubs/paramiko/paramiko/transport.pyi b/stubs/paramiko/paramiko/transport.pyi index efaacd9e7f9e..16b7f575cfa9 100644 --- a/stubs/paramiko/paramiko/transport.pyi +++ b/stubs/paramiko/paramiko/transport.pyi @@ -120,7 +120,7 @@ class Transport(Thread, ClosingContextManager): timeout: float | None = ..., ) -> Channel: ... def request_port_forward( - self, address: str, port: int, handler: Callable[[Channel, _Addr, _Addr], object] | None = ... + self, address: str, port: int, handler: Callable[[Channel, _Addr, _Addr], Any] | None = ... ) -> int: ... def cancel_port_forward(self, address: str, port: int) -> None: ... def open_sftp_client(self) -> SFTPClient | None: ... diff --git a/stubs/prettytable/prettytable/colortable.pyi b/stubs/prettytable/prettytable/colortable.pyi index 1cb3fc8bb60d..088dea79a8ba 100644 --- a/stubs/prettytable/prettytable/colortable.pyi +++ b/stubs/prettytable/prettytable/colortable.pyi @@ -6,7 +6,7 @@ from .prettytable import PrettyTable RESET_CODE: str -init: Callable[[], object] +init: Callable[[], Any] class Theme: default_color: str diff --git a/stubs/psutil/psutil/__init__.pyi b/stubs/psutil/psutil/__init__.pyi index 868dc1b66171..4240bd9ed11b 100644 --- a/stubs/psutil/psutil/__init__.pyi +++ b/stubs/psutil/psutil/__init__.pyi @@ -194,7 +194,7 @@ def process_iter( attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ... ) -> Iterator[Process]: ... def wait_procs( - procs: Iterable[Process], timeout: float | None = ..., callback: Callable[[Process], object] | None = ... + procs: Iterable[Process], timeout: float | None = ..., callback: Callable[[Process], Any] | None = ... ) -> tuple[list[Process], list[Process]]: ... def cpu_count(logical: bool = ...) -> int: ... def cpu_times(percpu: bool = ...): ... diff --git a/stubs/pyOpenSSL/OpenSSL/SSL.pyi b/stubs/pyOpenSSL/OpenSSL/SSL.pyi index 9881f91156e8..a66ece4a8bd3 100644 --- a/stubs/pyOpenSSL/OpenSSL/SSL.pyi +++ b/stubs/pyOpenSSL/OpenSSL/SSL.pyi @@ -193,7 +193,7 @@ class Context: def use_privatekey(self, pkey: PKey) -> None: ... def add_extra_chain_cert(self, certobj: X509) -> None: ... def set_cipher_list(self, cipher_list: bytes) -> None: ... - def set_keylog_callback(self, callback: Callable[[Connection, bytes], object]) -> None: ... + def set_keylog_callback(self, callback: Callable[[Connection, bytes], Any]) -> None: ... def set_alpn_protos(self, protos: Sequence[bytes]) -> None: ... def set_alpn_select_callback(self, callback: Callable[[Connection, list[bytes]], bytes]) -> None: ... def set_ocsp_server_callback(self, callback: Callable[[Connection, _T | None], bytes], data: _T | None = ...) -> None: ... diff --git a/stubs/pynput/pynput/_util.pyi b/stubs/pynput/pynput/_util.pyi index 4202bcb5464e..eb1ebe2a02ea 100644 --- a/stubs/pynput/pynput/_util.pyi +++ b/stubs/pynput/pynput/_util.pyi @@ -67,6 +67,6 @@ class Events(Generic[_T, _AbstractListener_T]): def __iter__(self: Self) -> Self: ... def __next__(self) -> _T: ... def get(self, timeout: float | None = ...) -> _T | None: ... - def _event_mapper(self, event: Callable[_P, object]) -> Callable[_P, None]: ... + def _event_mapper(self, event: Callable[_P, Any]) -> Callable[_P, None]: ... class NotifierMixin: ... diff --git a/stubs/pynput/pynput/keyboard/__init__.pyi b/stubs/pynput/pynput/keyboard/__init__.pyi index 7add8545394f..5d29819c9040 100644 --- a/stubs/pynput/pynput/keyboard/__init__.pyi +++ b/stubs/pynput/pynput/keyboard/__init__.pyi @@ -20,7 +20,7 @@ class Events(_util.Events[Any, Listener]): def get(self, timeout: float | None = ...) -> Press | Release | None: ... class HotKey: - def __init__(self, keys: list[KeyCode], on_activate: Callable[[], object]) -> None: ... + def __init__(self, keys: list[KeyCode], on_activate: Callable[[], Any]) -> None: ... @staticmethod def parse(keys: str) -> list[KeyCode]: ... def press(self, key: Key | KeyCode) -> None: ... diff --git a/stubs/pysftp/pysftp/__init__.pyi b/stubs/pysftp/pysftp/__init__.pyi index 89d52ead34bd..36f3a322d1f1 100644 --- a/stubs/pysftp/pysftp/__init__.pyi +++ b/stubs/pysftp/pysftp/__init__.pyi @@ -33,7 +33,7 @@ class CnOpts: def __init__(self, knownhosts: str | None = ...) -> None: ... def get_hostkey(self, host: str) -> paramiko.PKey: ... -_Callback: TypeAlias = Callable[[int, int], object] +_Callback: TypeAlias = Callable[[int, int], Any] _Path: TypeAlias = str | bytes class Connection: diff --git a/stubs/pysftp/pysftp/helpers.pyi b/stubs/pysftp/pysftp/helpers.pyi index f792cd3e13c1..6ded37e47feb 100644 --- a/stubs/pysftp/pysftp/helpers.pyi +++ b/stubs/pysftp/pysftp/helpers.pyi @@ -27,7 +27,7 @@ def path_advance(thepath: str, sep: str = ...) -> Iterator[str]: ... def path_retreat(thepath: str, sep: str = ...) -> Iterator[str]: ... def reparent(newparent: str, oldpath: str) -> str: ... -_PathCallback: TypeAlias = Callable[[str], object] +_PathCallback: TypeAlias = Callable[[str], Any] def walktree( localpath: str, fcallback: _PathCallback, dcallback: _PathCallback, ucallback: _PathCallback, recurse: bool = ... diff --git a/stubs/python-nmap/nmap/nmap.pyi b/stubs/python-nmap/nmap/nmap.pyi index 4b7aa0591dad..23b471acacfc 100644 --- a/stubs/python-nmap/nmap/nmap.pyi +++ b/stubs/python-nmap/nmap/nmap.pyi @@ -3,7 +3,7 @@ from typing import Any, TypeVar from typing_extensions import TypeAlias, TypedDict _T = TypeVar("_T") -_Callback: TypeAlias = Callable[[str, _Result], object] +_Callback: TypeAlias = Callable[[str, _Result], Any] class _Result(TypedDict): nmap: _ResultNmap diff --git a/stubs/redis/redis/asyncio/connection.pyi b/stubs/redis/redis/asyncio/connection.pyi index 84fdaa23cc7b..1cc9ebd7897c 100644 --- a/stubs/redis/redis/asyncio/connection.pyi +++ b/stubs/redis/redis/asyncio/connection.pyi @@ -247,7 +247,7 @@ FALSE_STRINGS: Any def to_bool(value) -> bool | None: ... -URL_QUERY_ARGUMENT_PARSERS: Mapping[str, Callable[..., object]] +URL_QUERY_ARGUMENT_PARSERS: Mapping[str, Callable[..., Any]] class ConnectKwargs(TypedDict): username: str diff --git a/stubs/redis/redis/connection.pyi b/stubs/redis/redis/connection.pyi index 88237fb0105e..31bec75689a2 100644 --- a/stubs/redis/redis/connection.pyi +++ b/stubs/redis/redis/connection.pyi @@ -25,7 +25,7 @@ URL_QUERY_ARGUMENT_PARSERS: dict[str, Callable[[Any], Any]] # Options as passed to Pool.get_connection(). _ConnectionPoolOptions: TypeAlias = Any -_ConnectFunc: TypeAlias = Callable[[Connection], object] +_ConnectFunc: TypeAlias = Callable[[Connection], Any] class BaseParser: EXCEPTION_CLASSES: ClassVar[dict[str, type[Exception] | dict[str, type[Exception]]]] diff --git a/stubs/redis/redis/retry.pyi b/stubs/redis/redis/retry.pyi index ec20224e8756..a2ca37acb3a8 100644 --- a/stubs/redis/redis/retry.pyi +++ b/stubs/redis/redis/retry.pyi @@ -8,4 +8,4 @@ _T = TypeVar("_T") class Retry: def __init__(self, backoff: AbstractBackoff, retries: int, supported_errors: tuple[type[Exception], ...] = ...) -> None: ... def update_supported_errors(self, specified_errors: Iterable[type[Exception]]) -> None: ... - def call_with_retry(self, do: Callable[[], _T], fail: Callable[[Exception], object]) -> _T: ... + def call_with_retry(self, do: Callable[[], _T], fail: Callable[[Exception], Any]) -> _T: ... diff --git a/stubs/setuptools/pkg_resources/__init__.pyi b/stubs/setuptools/pkg_resources/__init__.pyi index ceac29f7d60e..38f0d68eb228 100644 --- a/stubs/setuptools/pkg_resources/__init__.pyi +++ b/stubs/setuptools/pkg_resources/__init__.pyi @@ -36,7 +36,7 @@ class WorkingSet: self, requirements: Iterable[Requirement], env: Environment | None = ..., installer: _InstallerType | None = ... ) -> list[Distribution]: ... def add(self, dist: Distribution, entry: str | None = ..., insert: bool = ..., replace: bool = ...) -> None: ... - def subscribe(self, callback: Callable[[Distribution], object]) -> None: ... + def subscribe(self, callback: Callable[[Distribution], Any]) -> None: ... def find_plugins( self, plugin_env: Environment, full_env: Environment | None = ..., fallback: bool = ... ) -> tuple[list[Distribution], dict[Distribution, Exception]]: ... diff --git a/stubs/setuptools/setuptools/_distutils/ccompiler.pyi b/stubs/setuptools/setuptools/_distutils/ccompiler.pyi index 5b92c5f5c42e..df5963be2828 100644 --- a/stubs/setuptools/setuptools/_distutils/ccompiler.pyi +++ b/stubs/setuptools/setuptools/_distutils/ccompiler.pyi @@ -143,7 +143,7 @@ class CCompiler: def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ... def object_filenames(self, source_filenames: list[str], strip_dir: int = ..., output_dir: str = ...) -> list[str]: ... def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... - def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ... + def execute(self, func: Callable[..., Any], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ... def spawn(self, cmd: list[str]) -> None: ... def mkpath(self, name: str, mode: int = ...) -> None: ... def move_file(self, src: str, dst: str) -> str: ... diff --git a/stubs/setuptools/setuptools/_distutils/cmd.pyi b/stubs/setuptools/setuptools/_distutils/cmd.pyi index e706bdbc5802..8163ae78fd8f 100644 --- a/stubs/setuptools/setuptools/_distutils/cmd.pyi +++ b/stubs/setuptools/setuptools/_distutils/cmd.pyi @@ -25,7 +25,7 @@ class Command: def run_command(self, command: str) -> None: ... def get_sub_commands(self) -> list[str]: ... def warn(self, msg: str) -> None: ... - def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ... + def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ... def mkpath(self, name: str, mode: int = ...) -> None: ... def copy_file( self, @@ -60,7 +60,7 @@ class Command: self, infiles: str | list[str] | tuple[str, ...], outfile: str, - func: Callable[..., object], + func: Callable[..., Any], args: list[Any], exec_msg: str | None = ..., skip_msg: str | None = ..., diff --git a/stubs/setuptools/setuptools/_distutils/util.pyi b/stubs/setuptools/setuptools/_distutils/util.pyi index 6790712ffe25..099586141694 100644 --- a/stubs/setuptools/setuptools/_distutils/util.pyi +++ b/stubs/setuptools/setuptools/_distutils/util.pyi @@ -14,7 +14,7 @@ def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... def grok_environment_error(exc: object, prefix: str = ...) -> str: ... def split_quoted(s: str) -> list[str]: ... def execute( - func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ... + func: Callable[..., Any], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ... ) -> None: ... def strtobool(val: str) -> Literal[0, 1]: ... def byte_compile( diff --git a/stubs/six/six/__init__.pyi b/stubs/six/six/__init__.pyi index 7a084b3cc661..1c3f99c87c92 100644 --- a/stubs/six/six/__init__.pyi +++ b/stubs/six/six/__init__.pyi @@ -72,7 +72,7 @@ def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Itera @overload def assertRaisesRegex(self: unittest.TestCase, msg: str | None = ...) -> Any: ... @overload -def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., object], *args: Any, **kwargs: Any) -> Any: ... +def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... def assertRegex( self: unittest.TestCase, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: str | None = ... ) -> None: ... diff --git a/stubs/tqdm/tqdm/utils.pyi b/stubs/tqdm/tqdm/utils.pyi index 3055987cd92a..afbc0e57982f 100644 --- a/stubs/tqdm/tqdm/utils.pyi +++ b/stubs/tqdm/tqdm/utils.pyi @@ -49,7 +49,7 @@ class DisableOnWriteError(ObjectWrapper): def __eq__(self, other: object) -> bool: ... class CallbackIOWrapper(ObjectWrapper): - def __init__(self, callback: Callable[[int], object], stream, method: str = ...) -> None: ... + def __init__(self, callback: Callable[[int], Any], stream, method: str = ...) -> None: ... def disp_len(data: str) -> int: ... def disp_trim(data: str, length: int) -> str: ... diff --git a/stubs/waitress/waitress/runner.pyi b/stubs/waitress/waitress/runner.pyi index aeced93f4d9e..d7027001d345 100644 --- a/stubs/waitress/waitress/runner.pyi +++ b/stubs/waitress/waitress/runner.pyi @@ -10,4 +10,4 @@ def match(obj_name: str) -> tuple[str, str]: ... def resolve(module_name: str, object_name: str) -> Any: ... def show_help(stream: TextIOWrapper, name: str, error: str | None = ...) -> None: ... def show_exception(stream: TextIOWrapper) -> None: ... -def run(argv: Sequence[str] = ..., _serve: Callable[..., object] = ...) -> None: ... +def run(argv: Sequence[str] = ..., _serve: Callable[..., Any] = ...) -> None: ... diff --git a/stubs/waitress/waitress/trigger.pyi b/stubs/waitress/waitress/trigger.pyi index 0908963bab23..b9d9e28f5fba 100644 --- a/stubs/waitress/waitress/trigger.pyi +++ b/stubs/waitress/waitress/trigger.pyi @@ -16,7 +16,7 @@ class _triggerbase: def handle_connect(self) -> None: ... def handle_close(self) -> None: ... def close(self) -> None: ... - def pull_trigger(self, thunk: Callable[[None], object] | None = ...) -> None: ... + def pull_trigger(self, thunk: Callable[[None], Any] | None = ...) -> None: ... def handle_read(self) -> None: ... if sys.platform == "linux" or sys.platform == "darwin": From 9145d12e42072308743a6abd45e12b5816aa6165 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Mon, 25 Jul 2022 14:38:54 -0700 Subject: [PATCH 2/4] Revert "Use Callable[..., Any] instead of Callable[..., object]" This reverts commit ebedc98d04ba1da0a44c9d82ee04c9c54b73a7a7. --- stdlib/_compression.pyi | 2 +- stdlib/_dummy_thread.pyi | 2 +- stdlib/_dummy_threading.pyi | 4 +- stdlib/_thread.pyi | 2 +- stdlib/_typeshed/__init__.pyi | 2 +- stdlib/_typeshed/wsgi.pyi | 2 +- stdlib/asyncio/base_events.pyi | 10 ++-- stdlib/asyncio/base_subprocess.pyi | 2 +- stdlib/asyncio/coroutines.pyi | 2 +- stdlib/asyncio/events.pyi | 24 ++++----- stdlib/asyncio/futures.pyi | 4 +- stdlib/asyncio/sslproto.pyi | 4 +- stdlib/asyncio/unix_events.pyi | 12 ++--- stdlib/asyncio/windows_utils.pyi | 2 +- stdlib/atexit.pyi | 2 +- stdlib/builtins.pyi | 16 +++--- stdlib/concurrent/futures/_base.pyi | 2 +- stdlib/concurrent/futures/process.pyi | 8 +-- stdlib/concurrent/futures/thread.pyi | 7 ++- stdlib/distutils/ccompiler.pyi | 2 +- stdlib/distutils/cmd.pyi | 4 +- stdlib/distutils/util.pyi | 2 +- stdlib/doctest.pyi | 6 +-- stdlib/email/mime/application.pyi | 2 +- stdlib/email/mime/audio.pyi | 2 +- stdlib/email/mime/image.pyi | 2 +- stdlib/ftplib.pyi | 10 ++-- stdlib/functools.pyi | 2 +- stdlib/gc.pyi | 2 +- stdlib/inspect.pyi | 4 +- stdlib/itertools.pyi | 2 +- stdlib/lib2to3/pgen2/tokenize.pyi | 2 +- stdlib/multiprocessing/context.pyi | 4 +- stdlib/multiprocessing/dummy/__init__.pyi | 4 +- stdlib/multiprocessing/managers.pyi | 4 +- stdlib/multiprocessing/pool.pyi | 30 +++++------ stdlib/multiprocessing/process.pyi | 2 +- stdlib/multiprocessing/synchronize.pyi | 2 +- stdlib/os/__init__.pyi | 12 ++--- stdlib/pkgutil.pyi | 2 +- stdlib/pydoc.pyi | 6 +-- stdlib/readline.pyi | 4 +- stdlib/sched.pyi | 4 +- stdlib/shutil.pyi | 20 ++++--- stdlib/sqlite3/dbapi2.pyi | 10 ++-- stdlib/telnetlib.pyi | 2 +- stdlib/threading.pyi | 4 +- stdlib/timeit.pyi | 4 +- stdlib/turtle.pyi | 26 +++++----- stdlib/types.pyi | 4 +- stdlib/typing.pyi | 6 +-- stdlib/typing_extensions.pyi | 6 +-- stdlib/unittest/case.pyi | 22 ++++---- stdlib/urllib/request.pyi | 4 +- stdlib/urllib/response.pyi | 4 +- stdlib/weakref.pyi | 2 +- stdlib/wsgiref/types.pyi | 2 +- stdlib/xdrlib.pyi | 6 +-- stdlib/xml/etree/ElementTree.pyi | 2 +- stdlib/xmlrpc/client.pyi | 2 +- stubs/JACK-Client/jack/__init__.pyi | 32 ++++++------ .../sqlalchemy/engine/interfaces.pyi | 4 +- .../aws_xray_sdk/core/recorder.pyi | 2 +- stubs/boto/boto/s3/key.pyi | 22 ++++---- stubs/fpdf2/fpdf/fpdf.pyi | 2 +- stubs/gdb/gdb/__init__.pyi | 6 +-- stubs/gdb/gdb/events.pyi | 52 +++++++++---------- .../google/cloud/ndb/model.pyi | 16 +++--- stubs/invoke/invoke/util.pyi | 4 +- .../opentracing/harness/scope_check.pyi | 2 +- stubs/paramiko/paramiko/channel.pyi | 4 +- stubs/paramiko/paramiko/dsskey.pyi | 2 +- stubs/paramiko/paramiko/ecdsakey.pyi | 2 +- stubs/paramiko/paramiko/packet.pyi | 2 +- stubs/paramiko/paramiko/rsakey.pyi | 2 +- stubs/paramiko/paramiko/sftp_client.pyi | 2 +- stubs/paramiko/paramiko/transport.pyi | 2 +- stubs/prettytable/prettytable/colortable.pyi | 2 +- stubs/psutil/psutil/__init__.pyi | 2 +- stubs/pyOpenSSL/OpenSSL/SSL.pyi | 2 +- stubs/pynput/pynput/_util.pyi | 2 +- stubs/pynput/pynput/keyboard/__init__.pyi | 2 +- stubs/pysftp/pysftp/__init__.pyi | 2 +- stubs/pysftp/pysftp/helpers.pyi | 2 +- stubs/python-nmap/nmap/nmap.pyi | 2 +- stubs/redis/redis/asyncio/connection.pyi | 2 +- stubs/redis/redis/connection.pyi | 2 +- stubs/redis/redis/retry.pyi | 2 +- stubs/setuptools/pkg_resources/__init__.pyi | 2 +- .../setuptools/_distutils/ccompiler.pyi | 2 +- .../setuptools/setuptools/_distutils/cmd.pyi | 4 +- .../setuptools/setuptools/_distutils/util.pyi | 2 +- stubs/six/six/__init__.pyi | 2 +- stubs/tqdm/tqdm/utils.pyi | 2 +- stubs/waitress/waitress/runner.pyi | 2 +- stubs/waitress/waitress/trigger.pyi | 2 +- 96 files changed, 278 insertions(+), 271 deletions(-) diff --git a/stdlib/_compression.pyi b/stdlib/_compression.pyi index 57edb9812be3..ec3c7fe70856 100644 --- a/stdlib/_compression.pyi +++ b/stdlib/_compression.pyi @@ -16,7 +16,7 @@ class DecompressReader(RawIOBase): def __init__( self, fp: _Reader, - decomp_factory: Callable[..., Any], + decomp_factory: Callable[..., object], trailing_error: type[Exception] | tuple[type[Exception], ...] = ..., **decomp_args: Any, ) -> None: ... diff --git a/stdlib/_dummy_thread.pyi b/stdlib/_dummy_thread.pyi index 4cc9b9bc1b77..463399ca43db 100644 --- a/stdlib/_dummy_thread.pyi +++ b/stdlib/_dummy_thread.pyi @@ -7,7 +7,7 @@ __all__ = ["error", "start_new_thread", "exit", "get_ident", "allocate_lock", "i TIMEOUT_MAX: int error = RuntimeError -def start_new_thread(function: Callable[..., Any], args: tuple[Any, ...], kwargs: dict[str, Any] = ...) -> None: ... +def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any] = ...) -> None: ... def exit() -> NoReturn: ... def get_ident() -> int: ... def allocate_lock() -> LockType: ... diff --git a/stdlib/_dummy_threading.pyi b/stdlib/_dummy_threading.pyi index 583127500be8..c956946c8363 100644 --- a/stdlib/_dummy_threading.pyi +++ b/stdlib/_dummy_threading.pyi @@ -60,7 +60,7 @@ class Thread: def __init__( self, group: None = ..., - target: Callable[..., Any] | None = ..., + target: Callable[..., object] | None = ..., name: str | None = ..., args: Iterable[Any] = ..., kwargs: Mapping[str, Any] | None = ..., @@ -151,7 +151,7 @@ class Timer(Thread): def __init__( self, interval: float, - function: Callable[..., Any], + function: Callable[..., object], args: Iterable[Any] | None = ..., kwargs: Mapping[str, Any] | None = ..., ) -> None: ... diff --git a/stdlib/_thread.pyi b/stdlib/_thread.pyi index 10a191cbdf78..152362edcaea 100644 --- a/stdlib/_thread.pyi +++ b/stdlib/_thread.pyi @@ -19,7 +19,7 @@ class LockType: self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... -def start_new_thread(function: Callable[..., Any], args: tuple[Any, ...], kwargs: dict[str, Any] = ...) -> int: ... +def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any] = ...) -> int: ... def interrupt_main() -> None: ... def exit() -> NoReturn: ... def allocate_lock() -> LockType: ... diff --git a/stdlib/_typeshed/__init__.pyi b/stdlib/_typeshed/__init__.pyi index 307b80875874..89ca9d81619a 100644 --- a/stdlib/_typeshed/__init__.pyi +++ b/stdlib/_typeshed/__init__.pyi @@ -271,7 +271,7 @@ AnyOrLiteralStr = TypeVar("AnyOrLiteralStr", str, bytes, LiteralString) # noqa: StrOrLiteralStr = TypeVar("StrOrLiteralStr", LiteralString, str) # noqa: Y001 # Objects suitable to be passed to sys.setprofile, threading.setprofile, and similar -ProfileFunction: TypeAlias = Callable[[FrameType, str, Any], Any] +ProfileFunction: TypeAlias = Callable[[FrameType, str, Any], object] # Objects suitable to be passed to sys.settrace, threading.settrace, and similar # TODO: Ideally this would be a recursive type alias diff --git a/stdlib/_typeshed/wsgi.pyi b/stdlib/_typeshed/wsgi.pyi index 3e91ff4782a2..de731aea918b 100644 --- a/stdlib/_typeshed/wsgi.pyi +++ b/stdlib/_typeshed/wsgi.pyi @@ -21,7 +21,7 @@ else: class StartResponse(Protocol): def __call__( self, __status: str, __headers: list[tuple[str, str]], __exc_info: OptExcInfo | None = ... - ) -> Callable[[bytes], Any]: ... + ) -> Callable[[bytes], object]: ... WSGIEnvironment: TypeAlias = dict[str, Any] # stable WSGIApplication: TypeAlias = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] # stable diff --git a/stdlib/asyncio/base_events.pyi b/stdlib/asyncio/base_events.pyi index a5105b4f84c1..8697bfe306c4 100644 --- a/stdlib/asyncio/base_events.pyi +++ b/stdlib/asyncio/base_events.pyi @@ -20,7 +20,7 @@ else: _T = TypeVar("_T") _ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol) _Context: TypeAlias = dict[str, Any] -_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], Any] +_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], object] _ProtocolFactory: TypeAlias = Callable[[], BaseProtocol] _SSLContext: TypeAlias = bool | None | ssl.SSLContext @@ -74,11 +74,11 @@ class BaseEventLoop(AbstractEventLoop): def close(self) -> None: ... async def shutdown_asyncgens(self) -> None: ... # Methods scheduling callbacks. All these return Handles. - def call_soon(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... def call_later( - self, delay: float, callback: Callable[..., Any], *args: Any, context: Context | None = ... + self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = ... ) -> TimerHandle: ... - def call_at(self, when: float, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> TimerHandle: ... + def call_at(self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> TimerHandle: ... def time(self) -> float: ... # Future methods def create_future(self) -> Future[Any]: ... @@ -95,7 +95,7 @@ class BaseEventLoop(AbstractEventLoop): def set_task_factory(self, factory: _TaskFactory | None) -> None: ... def get_task_factory(self) -> _TaskFactory | None: ... # Methods for interacting with threads - def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Future[_T]: ... def set_default_executor(self, executor: Any) -> None: ... # Network I/O methods returning Futures. diff --git a/stdlib/asyncio/base_subprocess.pyi b/stdlib/asyncio/base_subprocess.pyi index 963cfa93de28..44606b6d137c 100644 --- a/stdlib/asyncio/base_subprocess.pyi +++ b/stdlib/asyncio/base_subprocess.pyi @@ -56,7 +56,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport): def terminate(self) -> None: ... def kill(self) -> None: ... async def _connect_pipes(self, waiter: futures.Future[Any] | None) -> None: ... # undocumented - def _call(self, cb: Callable[..., Any], *data: Any) -> None: ... # undocumented + def _call(self, cb: Callable[..., object], *data: Any) -> None: ... # undocumented def _pipe_connection_lost(self, fd: int, exc: BaseException | None) -> None: ... # undocumented def _pipe_data_received(self, fd: int, data: bytes) -> None: ... # undocumented def _process_exited(self, returncode: int) -> None: ... # undocumented diff --git a/stdlib/asyncio/coroutines.pyi b/stdlib/asyncio/coroutines.pyi index b6da90f62646..14fb627ae6fe 100644 --- a/stdlib/asyncio/coroutines.pyi +++ b/stdlib/asyncio/coroutines.pyi @@ -20,7 +20,7 @@ def iscoroutinefunction(func: Callable[..., Coroutine[Any, Any, Any]]) -> bool: @overload def iscoroutinefunction(func: Callable[_P, Awaitable[_T]]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, _T]]]: ... @overload -def iscoroutinefunction(func: Callable[_P, Any]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, Any]]]: ... +def iscoroutinefunction(func: Callable[_P, object]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, Any]]]: ... @overload def iscoroutinefunction(func: object) -> TypeGuard[Callable[..., Coroutine[Any, Any, Any]]]: ... diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index 659528fe1ea1..0eeebbc3ab8f 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -57,7 +57,7 @@ else: _T = TypeVar("_T") _ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol) _Context: TypeAlias = dict[str, Any] -_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], Any] +_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], object] _ProtocolFactory: TypeAlias = Callable[[], BaseProtocol] _SSLContext: TypeAlias = bool | None | ssl.SSLContext @@ -70,7 +70,7 @@ class Handle: _cancelled: bool _args: Sequence[Any] def __init__( - self, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = ... + self, callback: Callable[..., object], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = ... ) -> None: ... def cancel(self) -> None: ... def _run(self) -> None: ... @@ -80,7 +80,7 @@ class TimerHandle(Handle): def __init__( self, when: float, - callback: Callable[..., Any], + callback: Callable[..., object], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = ..., @@ -133,22 +133,22 @@ class AbstractEventLoop: # Methods scheduling callbacks. All these return Handles. if sys.version_info >= (3, 9): # "context" added in 3.9.10/3.10.2 @abstractmethod - def call_soon(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... @abstractmethod def call_later( - self, delay: float, callback: Callable[..., Any], *args: Any, context: Context | None = ... + self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = ... ) -> TimerHandle: ... @abstractmethod def call_at( - self, when: float, callback: Callable[..., Any], *args: Any, context: Context | None = ... + self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = ... ) -> TimerHandle: ... else: @abstractmethod - def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + def call_soon(self, callback: Callable[..., object], *args: Any) -> Handle: ... @abstractmethod - def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + def call_later(self, delay: float, callback: Callable[..., object], *args: Any) -> TimerHandle: ... @abstractmethod - def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + def call_at(self, when: float, callback: Callable[..., object], *args: Any) -> TimerHandle: ... @abstractmethod def time(self) -> float: ... @@ -181,10 +181,10 @@ class AbstractEventLoop: # Methods for interacting with threads if sys.version_info >= (3, 9): # "context" added in 3.9.10/3.10.2 @abstractmethod - def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... else: @abstractmethod - def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any) -> Handle: ... @abstractmethod def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Future[_T]: ... @@ -577,7 +577,7 @@ class AbstractEventLoop: async def sock_sendto(self, sock: socket, data: bytes, address: _Address) -> None: ... # Signal handling. @abstractmethod - def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ... + def add_signal_handler(self, sig: int, callback: Callable[..., object], *args: Any) -> None: ... @abstractmethod def remove_signal_handler(self, sig: int) -> bool: ... # Error handlers. diff --git a/stdlib/asyncio/futures.pyi b/stdlib/asyncio/futures.pyi index 96b5cb925099..f917bd5dee98 100644 --- a/stdlib/asyncio/futures.pyi +++ b/stdlib/asyncio/futures.pyi @@ -44,7 +44,7 @@ class Future(Awaitable[_T], Iterable[_T]): def get_loop(self) -> AbstractEventLoop: ... @property def _callbacks(self: Self) -> list[tuple[Callable[[Self], Any], Context]]: ... - def add_done_callback(self: Self, __fn: Callable[[Self], Any], *, context: Context | None = ...) -> None: ... + def add_done_callback(self: Self, __fn: Callable[[Self], object], *, context: Context | None = ...) -> None: ... if sys.version_info >= (3, 9): def cancel(self, msg: Any | None = ...) -> bool: ... else: @@ -54,7 +54,7 @@ class Future(Awaitable[_T], Iterable[_T]): def done(self) -> bool: ... def result(self) -> _T: ... def exception(self) -> BaseException | None: ... - def remove_done_callback(self: Self, __fn: Callable[[Self], Any]) -> int: ... + def remove_done_callback(self: Self, __fn: Callable[[Self], object]) -> int: ... def set_result(self, __result: _T) -> None: ... def set_exception(self, __exception: type | BaseException) -> None: ... def __iter__(self) -> Generator[Any, None, _T]: ... diff --git a/stdlib/asyncio/sslproto.pyi b/stdlib/asyncio/sslproto.pyi index 9cd66fc00391..34414d649297 100644 --- a/stdlib/asyncio/sslproto.pyi +++ b/stdlib/asyncio/sslproto.pyi @@ -57,8 +57,8 @@ if sys.version_info < (3, 11): def need_ssldata(self) -> bool: ... @property def wrapped(self) -> bool: ... - def do_handshake(self, callback: Callable[[BaseException | None], Any] | None = ...) -> list[bytes]: ... - def shutdown(self, callback: Callable[[], Any] | None = ...) -> list[bytes]: ... + def do_handshake(self, callback: Callable[[BaseException | None], object] | None = ...) -> list[bytes]: ... + def shutdown(self, callback: Callable[[], object] | None = ...) -> list[bytes]: ... def feed_eof(self) -> None: ... def feed_ssldata(self, data: bytes, only_handshake: bool = ...) -> tuple[list[bytes], list[bytes]]: ... def feed_appdata(self, data: bytes, offset: int = ...) -> tuple[list[bytes], int]: ... diff --git a/stdlib/asyncio/unix_events.pyi b/stdlib/asyncio/unix_events.pyi index 26b2ffb716a9..54e663ece192 100644 --- a/stdlib/asyncio/unix_events.pyi +++ b/stdlib/asyncio/unix_events.pyi @@ -14,7 +14,7 @@ from .selector_events import BaseSelectorEventLoop # So, it is special cased. class AbstractChildWatcher: @abstractmethod - def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... @abstractmethod def remove_child_handler(self, pid: int) -> bool: ... @abstractmethod @@ -67,13 +67,13 @@ if sys.platform != "win32": class SafeChildWatcher(BaseChildWatcher): def __enter__(self: Self) -> Self: ... def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ... - def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... class FastChildWatcher(BaseChildWatcher): def __enter__(self: Self) -> Self: ... def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ... - def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... class _UnixSelectorEventLoop(BaseSelectorEventLoop): ... @@ -102,7 +102,7 @@ if sys.platform != "win32": def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... - def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... @@ -115,7 +115,7 @@ if sys.platform != "win32": self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... def __del__(self, _warn: _Warn = ...) -> None: ... - def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... @@ -129,5 +129,5 @@ if sys.platform != "win32": def is_active(self) -> bool: ... def close(self) -> None: ... def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... - def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... + def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... diff --git a/stdlib/asyncio/windows_utils.pyi b/stdlib/asyncio/windows_utils.pyi index 093a8cf1c686..6e170dcb073a 100644 --- a/stdlib/asyncio/windows_utils.pyi +++ b/stdlib/asyncio/windows_utils.pyi @@ -30,7 +30,7 @@ if sys.platform == "win32": @property def handle(self) -> int: ... def fileno(self) -> int: ... - def close(self, *, CloseHandle: Callable[[int], Any] = ...) -> None: ... + def close(self, *, CloseHandle: Callable[[int], object] = ...) -> None: ... class Popen(subprocess.Popen[AnyStr]): stdin: PipeHandle | None # type: ignore[assignment] diff --git a/stdlib/atexit.pyi b/stdlib/atexit.pyi index f9d8e1d53050..ea041d7b5e46 100644 --- a/stdlib/atexit.pyi +++ b/stdlib/atexit.pyi @@ -9,4 +9,4 @@ def _clear() -> None: ... def _ncallbacks() -> int: ... def _run_exitfuncs() -> None: ... def register(func: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Callable[_P, _T]: ... -def unregister(func: Callable[..., Any]) -> None: ... +def unregister(func: Callable[..., object]) -> None: ... diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 8b527b8958d4..1a88e708aecd 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -177,7 +177,7 @@ class type: def __instancecheck__(self, __instance: Any) -> bool: ... def __subclasscheck__(self, __subclass: type) -> bool: ... @classmethod - def __prepare__(metacls, __name: str, __bases: tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ... + def __prepare__(metacls, __name: str, __bases: tuple[type, ...], **kwds: Any) -> Mapping[str, object]: ... if sys.version_info >= (3, 10): def __or__(self, __t: Any) -> types.UnionType: ... def __ror__(self, __t: Any) -> types.UnionType: ... @@ -1189,7 +1189,7 @@ def any(__iterable: Iterable[object]) -> bool: ... def ascii(__obj: object) -> str: ... def bin(__number: int | SupportsIndex) -> str: ... def breakpoint(*args: Any, **kws: Any) -> None: ... -def callable(__obj: object) -> TypeGuard[Callable[..., Any]]: ... +def callable(__obj: object) -> TypeGuard[Callable[..., object]]: ... def chr(__i: int) -> str: ... # We define this here instead of using os.PathLike to avoid import cycle issues. @@ -1243,10 +1243,10 @@ def divmod(__x: SupportsDivMod[_T_contra, _T_co], __y: _T_contra) -> _T_co: ... @overload def divmod(__x: _T_contra, __y: SupportsRDivMod[_T_contra, _T_co]) -> _T_co: ... -# The `globals` argument to `eval` has to be `dict[str, Any]` rather than `dict[str, Any]` due to invariance. +# The `globals` argument to `eval` has to be `dict[str, Any]` rather than `dict[str, object]` due to invariance. # (The `globals` argument has to be a "real dict", rather than any old mapping, unlike the `locals` argument.) def eval( - __source: str | ReadableBuffer | CodeType, __globals: dict[str, Any] | None = ..., __locals: Mapping[str, Any] | None = ... + __source: str | ReadableBuffer | CodeType, __globals: dict[str, Any] | None = ..., __locals: Mapping[str, object] | None = ... ) -> Any: ... # Comment above regarding `eval` applies to `exec` as well @@ -1254,7 +1254,7 @@ if sys.version_info >= (3, 11): def exec( __source: str | ReadableBuffer | CodeType, __globals: dict[str, Any] | None = ..., - __locals: Mapping[str, Any] | None = ..., + __locals: Mapping[str, object] | None = ..., *, closure: tuple[_Cell, ...] | None = ..., ) -> None: ... @@ -1263,7 +1263,7 @@ else: def exec( __source: str | ReadableBuffer | CodeType, __globals: dict[str, Any] | None = ..., - __locals: Mapping[str, Any] | None = ..., + __locals: Mapping[str, object] | None = ..., ) -> None: ... def exit(code: object = ...) -> NoReturn: ... @@ -1750,8 +1750,8 @@ class zip(Iterator[_T_co], Generic[_T_co]): # Return type of `__import__` should be kept the same as return type of `importlib.import_module` def __import__( name: str, - globals: Mapping[str, Any] | None = ..., - locals: Mapping[str, Any] | None = ..., + globals: Mapping[str, object] | None = ..., + locals: Mapping[str, object] | None = ..., fromlist: Sequence[str] = ..., level: int = ..., ) -> types.ModuleType: ... diff --git a/stdlib/concurrent/futures/_base.pyi b/stdlib/concurrent/futures/_base.pyi index 7a1e7e703fcd..9dd9be4d647e 100644 --- a/stdlib/concurrent/futures/_base.pyi +++ b/stdlib/concurrent/futures/_base.pyi @@ -49,7 +49,7 @@ class Future(Generic[_T]): def cancelled(self) -> bool: ... def running(self) -> bool: ... def done(self) -> bool: ... - def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ... + def add_done_callback(self, fn: Callable[[Future[_T]], object]) -> None: ... def result(self, timeout: float | None = ...) -> _T: ... def set_running_or_notify_cancel(self) -> bool: ... def set_result(self, result: _T) -> None: ... diff --git a/stdlib/concurrent/futures/process.pyi b/stdlib/concurrent/futures/process.pyi index cb4fdefc270d..211107cf357d 100644 --- a/stdlib/concurrent/futures/process.pyi +++ b/stdlib/concurrent/futures/process.pyi @@ -110,7 +110,7 @@ if sys.version_info >= (3, 11): def _process_worker( call_queue: Queue[_CallItem], result_queue: SimpleQueue[_ResultItem], - initializer: Callable[..., Any] | None, + initializer: Callable[..., object] | None, initargs: tuple[Any, ...], max_tasks: int | None = ..., ) -> None: ... @@ -119,7 +119,7 @@ else: def _process_worker( call_queue: Queue[_CallItem], result_queue: SimpleQueue[_ResultItem], - initializer: Callable[..., Any] | None, + initializer: Callable[..., object] | None, initargs: tuple[Any, ...], ) -> None: ... @@ -174,7 +174,7 @@ class ProcessPoolExecutor(Executor): self, max_workers: int | None = ..., mp_context: BaseContext | None = ..., - initializer: Callable[..., Any] | None = ..., + initializer: Callable[..., object] | None = ..., initargs: tuple[Any, ...] = ..., *, max_tasks_per_child: int | None = ..., @@ -184,7 +184,7 @@ class ProcessPoolExecutor(Executor): self, max_workers: int | None = ..., mp_context: BaseContext | None = ..., - initializer: Callable[..., Any] | None = ..., + initializer: Callable[..., object] | None = ..., initargs: tuple[Any, ...] = ..., ) -> None: ... if sys.version_info >= (3, 9): diff --git a/stdlib/concurrent/futures/thread.pyi b/stdlib/concurrent/futures/thread.pyi index cc10ee7a31e2..387ce0d7e438 100644 --- a/stdlib/concurrent/futures/thread.pyi +++ b/stdlib/concurrent/futures/thread.pyi @@ -29,7 +29,10 @@ class _WorkItem(Generic[_S]): def __class_getitem__(cls, item: Any) -> GenericAlias: ... def _worker( - executor_reference: ref[Any], work_queue: queue.SimpleQueue[Any], initializer: Callable[..., Any], initargs: tuple[Any, ...] + executor_reference: ref[Any], + work_queue: queue.SimpleQueue[Any], + initializer: Callable[..., object], + initargs: tuple[Any, ...], ) -> None: ... class BrokenThreadPool(BrokenExecutor): ... @@ -49,7 +52,7 @@ class ThreadPoolExecutor(Executor): self, max_workers: int | None = ..., thread_name_prefix: str = ..., - initializer: Callable[..., Any] | None = ..., + initializer: Callable[..., object] | None = ..., initargs: tuple[Any, ...] = ..., ) -> None: ... def _adjust_thread_count(self) -> None: ... diff --git a/stdlib/distutils/ccompiler.pyi b/stdlib/distutils/ccompiler.pyi index df5963be2828..5b92c5f5c42e 100644 --- a/stdlib/distutils/ccompiler.pyi +++ b/stdlib/distutils/ccompiler.pyi @@ -143,7 +143,7 @@ class CCompiler: def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ... def object_filenames(self, source_filenames: list[str], strip_dir: int = ..., output_dir: str = ...) -> list[str]: ... def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... - def execute(self, func: Callable[..., Any], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ... + def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ... def spawn(self, cmd: list[str]) -> None: ... def mkpath(self, name: str, mode: int = ...) -> None: ... def move_file(self, src: str, dst: str) -> str: ... diff --git a/stdlib/distutils/cmd.pyi b/stdlib/distutils/cmd.pyi index 8163ae78fd8f..e706bdbc5802 100644 --- a/stdlib/distutils/cmd.pyi +++ b/stdlib/distutils/cmd.pyi @@ -25,7 +25,7 @@ class Command: def run_command(self, command: str) -> None: ... def get_sub_commands(self) -> list[str]: ... def warn(self, msg: str) -> None: ... - def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ... + def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ... def mkpath(self, name: str, mode: int = ...) -> None: ... def copy_file( self, @@ -60,7 +60,7 @@ class Command: self, infiles: str | list[str] | tuple[str, ...], outfile: str, - func: Callable[..., Any], + func: Callable[..., object], args: list[Any], exec_msg: str | None = ..., skip_msg: str | None = ..., diff --git a/stdlib/distutils/util.pyi b/stdlib/distutils/util.pyi index 5c2f46c89151..da8d66063536 100644 --- a/stdlib/distutils/util.pyi +++ b/stdlib/distutils/util.pyi @@ -10,7 +10,7 @@ def check_environ() -> None: ... def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... def split_quoted(s: str) -> list[str]: ... def execute( - func: Callable[..., Any], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ... + func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ... ) -> None: ... def strtobool(val: str) -> Literal[0, 1]: ... def byte_compile( diff --git a/stdlib/doctest.pyi b/stdlib/doctest.pyi index c767436c2be8..6bb1bf9d33c5 100644 --- a/stdlib/doctest.pyi +++ b/stdlib/doctest.pyi @@ -126,7 +126,7 @@ class DocTestFinder: extraglobs: dict[str, Any] | None = ..., ) -> list[DocTest]: ... -_Out: TypeAlias = Callable[[str], Any] +_Out: TypeAlias = Callable[[str], object] class DocTestRunner: DIVIDER: str @@ -201,8 +201,8 @@ class DocTestCase(unittest.TestCase): self, test: DocTest, optionflags: int = ..., - setUp: Callable[[DocTest], Any] | None = ..., - tearDown: Callable[[DocTest], Any] | None = ..., + setUp: Callable[[DocTest], object] | None = ..., + tearDown: Callable[[DocTest], object] | None = ..., checker: OutputChecker | None = ..., ) -> None: ... def setUp(self) -> None: ... diff --git a/stdlib/email/mime/application.pyi b/stdlib/email/mime/application.pyi index e797e4d53456..dfff85265ade 100644 --- a/stdlib/email/mime/application.pyi +++ b/stdlib/email/mime/application.pyi @@ -10,7 +10,7 @@ class MIMEApplication(MIMENonMultipart): self, _data: str | bytes, _subtype: str = ..., - _encoder: Callable[[MIMEApplication], Any] = ..., + _encoder: Callable[[MIMEApplication], object] = ..., *, policy: Policy | None = ..., **_params: _ParamsType, diff --git a/stdlib/email/mime/audio.pyi b/stdlib/email/mime/audio.pyi index f4b28409c528..b355d55070ad 100644 --- a/stdlib/email/mime/audio.pyi +++ b/stdlib/email/mime/audio.pyi @@ -10,7 +10,7 @@ class MIMEAudio(MIMENonMultipart): self, _audiodata: str | bytes, _subtype: str | None = ..., - _encoder: Callable[[MIMEAudio], Any] = ..., + _encoder: Callable[[MIMEAudio], object] = ..., *, policy: Policy | None = ..., **_params: _ParamsType, diff --git a/stdlib/email/mime/image.pyi b/stdlib/email/mime/image.pyi index b2ae216af534..f575103de2d6 100644 --- a/stdlib/email/mime/image.pyi +++ b/stdlib/email/mime/image.pyi @@ -10,7 +10,7 @@ class MIMEImage(MIMENonMultipart): self, _imagedata: str | bytes, _subtype: str | None = ..., - _encoder: Callable[[MIMEImage], Any] = ..., + _encoder: Callable[[MIMEImage], object] = ..., *, policy: Policy | None = ..., **_params: _ParamsType, diff --git a/stdlib/ftplib.pyi b/stdlib/ftplib.pyi index 960de135c0e8..3d284c597019 100644 --- a/stdlib/ftplib.pyi +++ b/stdlib/ftplib.pyi @@ -90,22 +90,22 @@ class FTP: def ntransfercmd(self, cmd: str, rest: int | str | None = ...) -> tuple[socket, int]: ... def transfercmd(self, cmd: str, rest: int | str | None = ...) -> socket: ... def retrbinary( - self, cmd: str, callback: Callable[[bytes], Any], blocksize: int = ..., rest: int | str | None = ... + self, cmd: str, callback: Callable[[bytes], object], blocksize: int = ..., rest: int | str | None = ... ) -> str: ... def storbinary( self, cmd: str, fp: SupportsRead[bytes], blocksize: int = ..., - callback: Callable[[bytes], Any] | None = ..., + callback: Callable[[bytes], object] | None = ..., rest: int | str | None = ..., ) -> str: ... - def retrlines(self, cmd: str, callback: Callable[[str], Any] | None = ...) -> str: ... - def storlines(self, cmd: str, fp: SupportsReadline[bytes], callback: Callable[[bytes], Any] | None = ...) -> str: ... + def retrlines(self, cmd: str, callback: Callable[[str], object] | None = ...) -> str: ... + def storlines(self, cmd: str, fp: SupportsReadline[bytes], callback: Callable[[bytes], object] | None = ...) -> str: ... def acct(self, password: str) -> str: ... def nlst(self, *args: str) -> list[str]: ... # Technically only the last arg can be a Callable but ... - def dir(self, *args: str | Callable[[str], Any]) -> None: ... + def dir(self, *args: str | Callable[[str], object]) -> None: ... def mlsd(self, path: str = ..., facts: Iterable[str] = ...) -> Iterator[tuple[str, dict[str, str]]]: ... def rename(self, fromname: str, toname: str) -> str: ... def delete(self, filename: str) -> str: ... diff --git a/stdlib/functools.pyi b/stdlib/functools.pyi index 3003ef061a84..5c3f662c3dd5 100644 --- a/stdlib/functools.pyi +++ b/stdlib/functools.pyi @@ -28,7 +28,7 @@ if sys.version_info >= (3, 8): if sys.version_info >= (3, 9): __all__ += ["cache"] -_AnyCallable: TypeAlias = Callable[..., Any] +_AnyCallable: TypeAlias = Callable[..., object] _T = TypeVar("_T") _S = TypeVar("_S") diff --git a/stdlib/gc.pyi b/stdlib/gc.pyi index 3518f176ffb1..d24b7c1f4c7c 100644 --- a/stdlib/gc.pyi +++ b/stdlib/gc.pyi @@ -9,7 +9,7 @@ DEBUG_SAVEALL: Literal[32] DEBUG_STATS: Literal[1] DEBUG_UNCOLLECTABLE: Literal[4] -_CallbackType: TypeAlias = Callable[[Literal["start", "stop"], dict[str, int]], Any] +_CallbackType: TypeAlias = Callable[[Literal["start", "stop"], dict[str, int]], object] callbacks: list[_CallbackType] garbage: list[Any] diff --git a/stdlib/inspect.pyi b/stdlib/inspect.pyi index 02fa19f1e368..7f9667c6ebed 100644 --- a/stdlib/inspect.pyi +++ b/stdlib/inspect.pyi @@ -188,7 +188,7 @@ if sys.version_info >= (3, 8): @overload def iscoroutinefunction(obj: Callable[_P, Awaitable[_T]]) -> TypeGuard[Callable[_P, CoroutineType[Any, Any, _T]]]: ... @overload - def iscoroutinefunction(obj: Callable[_P, Any]) -> TypeGuard[Callable[_P, CoroutineType[Any, Any, Any]]]: ... + def iscoroutinefunction(obj: Callable[_P, object]) -> TypeGuard[Callable[_P, CoroutineType[Any, Any, Any]]]: ... @overload def iscoroutinefunction(obj: object) -> TypeGuard[Callable[..., CoroutineType[Any, Any, Any]]]: ... @@ -335,7 +335,7 @@ class Signature: if sys.version_info >= (3, 10): def get_annotations( - obj: Callable[..., Any] | type[Any] | ModuleType, + obj: Callable[..., object] | type[Any] | ModuleType, *, globals: Mapping[str, Any] | None = ..., locals: Mapping[str, Any] | None = ..., diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index f365ad570050..7299ee8200db 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -20,7 +20,7 @@ _T6 = TypeVar("_T6") _Step: TypeAlias = SupportsFloat | SupportsInt | SupportsIndex | SupportsComplex -_Predicate: TypeAlias = Callable[[_T], Any] +_Predicate: TypeAlias = Callable[[_T], object] # Technically count can take anything that implements a number protocol and has an add method # but we can't enforce the add method diff --git a/stdlib/lib2to3/pgen2/tokenize.pyi b/stdlib/lib2to3/pgen2/tokenize.pyi index f71661c81508..c9ad1e7bb411 100644 --- a/stdlib/lib2to3/pgen2/tokenize.pyi +++ b/stdlib/lib2to3/pgen2/tokenize.pyi @@ -75,7 +75,7 @@ __all__ = [ ] _Coord: TypeAlias = tuple[int, int] -_TokenEater: TypeAlias = Callable[[int, str, _Coord, _Coord, str], Any] +_TokenEater: TypeAlias = Callable[[int, str, _Coord, _Coord, str], object] _TokenInfo: TypeAlias = tuple[int, str, _Coord, _Coord, str] class TokenError(Exception): ... diff --git a/stdlib/multiprocessing/context.pyi b/stdlib/multiprocessing/context.pyi index 60df547e7335..7215955da535 100644 --- a/stdlib/multiprocessing/context.pyi +++ b/stdlib/multiprocessing/context.pyi @@ -47,7 +47,7 @@ class BaseContext: def Manager(self) -> SyncManager: ... def Pipe(self, duplex: bool = ...) -> tuple[_ConnectionBase, _ConnectionBase]: ... def Barrier( - self, parties: int, action: Callable[..., Any] | None = ..., timeout: float | None = ... + self, parties: int, action: Callable[..., object] | None = ..., timeout: float | None = ... ) -> synchronize.Barrier: ... def BoundedSemaphore(self, value: int = ...) -> synchronize.BoundedSemaphore: ... def Condition(self, lock: _LockLike | None = ...) -> synchronize.Condition: ... @@ -61,7 +61,7 @@ class BaseContext: def Pool( self, processes: int | None = ..., - initializer: Callable[..., Any] | None = ..., + initializer: Callable[..., object] | None = ..., initargs: Iterable[Any] = ..., maxtasksperchild: int | None = ..., ) -> _Pool: ... diff --git a/stdlib/multiprocessing/dummy/__init__.pyi b/stdlib/multiprocessing/dummy/__init__.pyi index 5a34cdd12a9f..5d289c058e03 100644 --- a/stdlib/multiprocessing/dummy/__init__.pyi +++ b/stdlib/multiprocessing/dummy/__init__.pyi @@ -48,7 +48,7 @@ class DummyProcess(threading.Thread): def __init__( self, group: Any = ..., - target: Callable[..., Any] | None = ..., + target: Callable[..., object] | None = ..., name: str | None = ..., args: Iterable[Any] = ..., kwargs: Mapping[str, Any] = ..., @@ -69,7 +69,7 @@ class Value: def Array(typecode: Any, sequence: Sequence[Any], lock: Any = ...) -> array.array[Any]: ... def Manager() -> Any: ... -def Pool(processes: int | None = ..., initializer: Callable[..., Any] | None = ..., initargs: Iterable[Any] = ...) -> Any: ... +def Pool(processes: int | None = ..., initializer: Callable[..., object] | None = ..., initargs: Iterable[Any] = ...) -> Any: ... def active_children() -> list[Any]: ... current_process = threading.current_thread diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index 13a52996bc4c..dfbcb395ef1a 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -146,7 +146,7 @@ class BaseManager: def get_server(self) -> Server: ... def connect(self) -> None: ... - def start(self, initializer: Callable[..., Any] | None = ..., initargs: Iterable[Any] = ...) -> None: ... + def start(self, initializer: Callable[..., object] | None = ..., initargs: Iterable[Any] = ...) -> None: ... def shutdown(self) -> None: ... # only available after start() was called def join(self, timeout: float | None = ...) -> None: ... # undocumented @property @@ -155,7 +155,7 @@ class BaseManager: def register( cls, typeid: str, - callable: Callable[..., Any] | None = ..., + callable: Callable[..., object] | None = ..., proxytype: Any = ..., exposed: Sequence[str] | None = ..., method_to_typeid: Mapping[str, str] | None = ..., diff --git a/stdlib/multiprocessing/pool.pyi b/stdlib/multiprocessing/pool.pyi index 44bd35468026..2b97e16f0525 100644 --- a/stdlib/multiprocessing/pool.pyi +++ b/stdlib/multiprocessing/pool.pyi @@ -16,14 +16,14 @@ _T = TypeVar("_T") class ApplyResult(Generic[_T]): if sys.version_info >= (3, 8): def __init__( - self, pool: Pool, callback: Callable[[_T], Any] | None, error_callback: Callable[[BaseException], Any] | None + self, pool: Pool, callback: Callable[[_T], object] | None, error_callback: Callable[[BaseException], object] | None ) -> None: ... else: def __init__( self, cache: dict[int, ApplyResult[Any]], - callback: Callable[[_T], Any] | None, - error_callback: Callable[[BaseException], Any] | None, + callback: Callable[[_T], object] | None, + error_callback: Callable[[BaseException], object] | None, ) -> None: ... def get(self, timeout: float | None = ...) -> _T: ... @@ -43,8 +43,8 @@ class MapResult(ApplyResult[list[_T]]): pool: Pool, chunksize: int, length: int, - callback: Callable[[list[_T]], Any] | None, - error_callback: Callable[[BaseException], Any] | None, + callback: Callable[[list[_T]], object] | None, + error_callback: Callable[[BaseException], object] | None, ) -> None: ... else: def __init__( @@ -52,8 +52,8 @@ class MapResult(ApplyResult[list[_T]]): cache: dict[int, ApplyResult[Any]], chunksize: int, length: int, - callback: Callable[[list[_T]], Any] | None, - error_callback: Callable[[BaseException], Any] | None, + callback: Callable[[list[_T]], object] | None, + error_callback: Callable[[BaseException], object] | None, ) -> None: ... class IMapIterator(Iterator[_T]): @@ -72,7 +72,7 @@ class Pool: def __init__( self, processes: int | None = ..., - initializer: Callable[..., Any] | None = ..., + initializer: Callable[..., object] | None = ..., initargs: Iterable[Any] = ..., maxtasksperchild: int | None = ..., context: Any | None = ..., @@ -83,8 +83,8 @@ class Pool: func: Callable[..., _T], args: Iterable[Any] = ..., kwds: Mapping[str, Any] = ..., - callback: Callable[[_T], Any] | None = ..., - error_callback: Callable[[BaseException], Any] | None = ..., + callback: Callable[[_T], object] | None = ..., + error_callback: Callable[[BaseException], object] | None = ..., ) -> AsyncResult[_T]: ... def map(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = ...) -> list[_T]: ... def map_async( @@ -92,8 +92,8 @@ class Pool: func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = ..., - callback: Callable[[_T], Any] | None = ..., - error_callback: Callable[[BaseException], Any] | None = ..., + callback: Callable[[_T], object] | None = ..., + error_callback: Callable[[BaseException], object] | None = ..., ) -> MapResult[_T]: ... def imap(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = ...) -> IMapIterator[_T]: ... def imap_unordered( @@ -105,8 +105,8 @@ class Pool: func: Callable[..., _T], iterable: Iterable[Iterable[Any]], chunksize: int | None = ..., - callback: Callable[[_T], Any] | None = ..., - error_callback: Callable[[BaseException], Any] | None = ..., + callback: Callable[[_T], object] | None = ..., + error_callback: Callable[[BaseException], object] | None = ..., ) -> AsyncResult[list[_T]]: ... def close(self) -> None: ... def terminate(self) -> None: ... @@ -118,7 +118,7 @@ class Pool: class ThreadPool(Pool): def __init__( - self, processes: int | None = ..., initializer: Callable[..., Any] | None = ..., initargs: Iterable[Any] = ... + self, processes: int | None = ..., initializer: Callable[..., object] | None = ..., initargs: Iterable[Any] = ... ) -> None: ... # undocumented diff --git a/stdlib/multiprocessing/process.pyi b/stdlib/multiprocessing/process.pyi index 7a77a46192d1..7c8422e391c2 100644 --- a/stdlib/multiprocessing/process.pyi +++ b/stdlib/multiprocessing/process.pyi @@ -15,7 +15,7 @@ class BaseProcess: def __init__( self, group: None = ..., - target: Callable[..., Any] | None = ..., + target: Callable[..., object] | None = ..., name: str | None = ..., args: Iterable[Any] = ..., kwargs: Mapping[str, Any] = ..., diff --git a/stdlib/multiprocessing/synchronize.pyi b/stdlib/multiprocessing/synchronize.pyi index d96731bae4e2..c89142f2cd3b 100644 --- a/stdlib/multiprocessing/synchronize.pyi +++ b/stdlib/multiprocessing/synchronize.pyi @@ -11,7 +11,7 @@ _LockLike: TypeAlias = Lock | RLock class Barrier(threading.Barrier): def __init__( - self, parties: int, action: Callable[[], Any] | None = ..., timeout: float | None = ..., *ctx: BaseContext + self, parties: int, action: Callable[[], object] | None = ..., timeout: float | None = ..., *ctx: BaseContext ) -> None: ... class BoundedSemaphore(Semaphore): diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 17654f4e4de9..e3d428555462 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -213,8 +213,8 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): decodevalue: _EnvironCodeFunc[AnyStr], ) -> None: ... else: - putenv: Callable[[AnyStr, AnyStr], Any] - unsetenv: Callable[[AnyStr, AnyStr], Any] + putenv: Callable[[AnyStr, AnyStr], object] + unsetenv: Callable[[AnyStr, AnyStr], object] def __init__( self, data: MutableMapping[AnyStr, AnyStr], @@ -222,8 +222,8 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): decodekey: _EnvironCodeFunc[AnyStr], encodevalue: _EnvironCodeFunc[AnyStr], decodevalue: _EnvironCodeFunc[AnyStr], - putenv: Callable[[AnyStr, AnyStr], Any], - unsetenv: Callable[[AnyStr, AnyStr], Any], + putenv: Callable[[AnyStr, AnyStr], object], + unsetenv: Callable[[AnyStr, AnyStr], object], ) -> None: ... def setdefault(self, key: AnyStr, value: AnyStr) -> AnyStr: ... # type: ignore[override] @@ -754,7 +754,7 @@ def utime( follow_symlinks: bool = ..., ) -> None: ... -_OnError: TypeAlias = Callable[[OSError], Any] +_OnError: TypeAlias = Callable[[OSError], object] def walk( top: GenericPath[AnyStr], topdown: bool = ..., onerror: _OnError | None = ..., followlinks: bool = ... @@ -974,7 +974,7 @@ if sys.version_info >= (3, 8): if sys.platform == "win32": class _AddedDllDirectory: path: str | None - def __init__(self, path: str | None, cookie: _T, remove_dll_directory: Callable[[_T], Any]) -> None: ... + def __init__(self, path: str | None, cookie: _T, remove_dll_directory: Callable[[_T], object]) -> None: ... def close(self) -> None: ... def __enter__(self: Self) -> Self: ... def __exit__(self, *args: object) -> None: ... diff --git a/stdlib/pkgutil.pyi b/stdlib/pkgutil.pyi index e4fb523e1074..f91ab78ff35d 100644 --- a/stdlib/pkgutil.pyi +++ b/stdlib/pkgutil.pyi @@ -41,7 +41,7 @@ def iter_importers(fullname: str = ...) -> Iterator[MetaPathFinder | PathEntryFi def iter_modules(path: Iterable[str] | None = ..., prefix: str = ...) -> Iterator[ModuleInfo]: ... def read_code(stream: SupportsRead[bytes]) -> Any: ... # undocumented def walk_packages( - path: Iterable[str] | None = ..., prefix: str = ..., onerror: Callable[[str], Any] | None = ... + path: Iterable[str] | None = ..., prefix: str = ..., onerror: Callable[[str], object] | None = ... ) -> Iterator[ModuleInfo]: ... def get_data(package: str, resource: str) -> bytes | None: ... diff --git a/stdlib/pydoc.pyi b/stdlib/pydoc.pyi index 5bb01aa0e54a..abcffc31111a 100644 --- a/stdlib/pydoc.pyi +++ b/stdlib/pydoc.pyi @@ -236,10 +236,10 @@ class ModuleScanner: quit: bool def run( self, - callback: Callable[[str | None, str, str], Any], + callback: Callable[[str | None, str, str], object], key: str | None = ..., - completer: Callable[[], Any] | None = ..., - onerror: Callable[[str], Any] | None = ..., + completer: Callable[[], object] | None = ..., + onerror: Callable[[str], object] | None = ..., ) -> None: ... def apropos(key: str) -> None: ... diff --git a/stdlib/readline.pyi b/stdlib/readline.pyi index 36631dc66cb6..ceca2e32f221 100644 --- a/stdlib/readline.pyi +++ b/stdlib/readline.pyi @@ -24,8 +24,8 @@ if sys.platform != "win32": def replace_history_item(__pos: int, __line: str) -> None: ... def add_history(__string: str) -> None: ... def set_auto_history(__enabled: bool) -> None: ... - def set_startup_hook(__function: Callable[[], Any] | None = ...) -> None: ... - def set_pre_input_hook(__function: Callable[[], Any] | None = ...) -> None: ... + def set_startup_hook(__function: Callable[[], object] | None = ...) -> None: ... + def set_pre_input_hook(__function: Callable[[], object] | None = ...) -> None: ... def set_completer(__function: _Completer | None = ...) -> None: ... def get_completer() -> _Completer | None: ... def get_completion_type() -> int: ... diff --git a/stdlib/sched.pyi b/stdlib/sched.pyi index 6dba29ec135e..29c84f951124 100644 --- a/stdlib/sched.pyi +++ b/stdlib/sched.pyi @@ -26,9 +26,9 @@ else: class scheduler: timefunc: Callable[[], float] - delayfunc: Callable[[float], Any] + delayfunc: Callable[[float], object] - def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], Any] = ...) -> None: ... + def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], object] = ...) -> None: ... def enterabs( self, time: float, priority: Any, action: _ActionCallback, argument: tuple[Any, ...] = ..., kwargs: dict[str, Any] = ... ) -> Event: ... diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index bcf6e4a53546..13c706de1cf4 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -67,7 +67,7 @@ if sys.version_info >= (3, 8): dst: StrPath, symlinks: bool = ..., ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = ..., - copy_function: Callable[[str, str], Any] = ..., + copy_function: Callable[[str, str], object] = ..., ignore_dangling_symlinks: bool = ..., dirs_exist_ok: bool = ..., ) -> _PathReturn: ... @@ -78,11 +78,11 @@ else: dst: StrPath, symlinks: bool = ..., ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = ..., - copy_function: Callable[[str, str], Any] = ..., + copy_function: Callable[[str, str], object] = ..., ignore_dangling_symlinks: bool = ..., ) -> _PathReturn: ... -_OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], Any, Any], Any] +_OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], Any, Any], object] if sys.version_info >= (3, 11): def rmtree( @@ -92,7 +92,7 @@ if sys.version_info >= (3, 11): else: def rmtree(path: StrOrBytesPath, ignore_errors: bool = ..., onerror: _OnErrorCallback | None = ...) -> None: ... -_CopyFn: TypeAlias = Callable[[str, str], Any] | Callable[[StrPath, StrPath], Any] +_CopyFn: TypeAlias = Callable[[str, str], object] | Callable[[StrPath, StrPath], object] # N.B. shutil.move appears to take bytes arguments, however, # this does not work when dst is (or is within) an existing directory. @@ -146,21 +146,25 @@ def make_archive( def get_archive_formats() -> list[tuple[str, str]]: ... @overload def register_archive_format( - name: str, function: Callable[..., Any], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = ... + name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = ... ) -> None: ... @overload def register_archive_format( - name: str, function: Callable[[str, str], Any], extra_args: None = ..., description: str = ... + name: str, function: Callable[[str, str], object], extra_args: None = ..., description: str = ... ) -> None: ... def unregister_archive_format(name: str) -> None: ... def unpack_archive(filename: StrPath, extract_dir: StrPath | None = ..., format: str | None = ...) -> None: ... @overload def register_unpack_format( - name: str, extensions: list[str], function: Callable[..., Any], extra_args: Sequence[tuple[str, Any]], description: str = ... + name: str, + extensions: list[str], + function: Callable[..., object], + extra_args: Sequence[tuple[str, Any]], + description: str = ..., ) -> None: ... @overload def register_unpack_format( - name: str, extensions: list[str], function: Callable[[str, str], Any], extra_args: None = ..., description: str = ... + name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = ..., description: str = ... ) -> None: ... def unregister_unpack_format(name: str) -> None: ... def get_unpack_formats() -> list[tuple[str, list[str], str]]: ... diff --git a/stdlib/sqlite3/dbapi2.pyi b/stdlib/sqlite3/dbapi2.pyi index fae0273a062f..44595d5ae556 100644 --- a/stdlib/sqlite3/dbapi2.pyi +++ b/stdlib/sqlite3/dbapi2.pyi @@ -249,8 +249,8 @@ class _AnyParamWindowAggregateClass(Protocol): def finalize(self) -> _SqliteData: ... class _WindowAggregateClass(Protocol): - step: Callable[..., Any] - inverse: Callable[..., Any] + step: Callable[..., object] + inverse: Callable[..., object] def value(self) -> _SqliteData: ... def finalize(self) -> _SqliteData: ... @@ -338,7 +338,7 @@ class Connection: self, authorizer_callback: Callable[[int, str | None, str | None, str | None, str | None], int] | None ) -> None: ... def set_progress_handler(self, progress_handler: Callable[[], int | None] | None, n: int) -> None: ... - def set_trace_callback(self, trace_callback: Callable[[str], Any] | None) -> None: ... + def set_trace_callback(self, trace_callback: Callable[[str], object] | None) -> None: ... # enable_load_extension and load_extension is not available on python distributions compiled # without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1 def enable_load_extension(self, __enabled: bool) -> None: ... @@ -348,7 +348,7 @@ class Connection: target: Connection, *, pages: int = ..., - progress: Callable[[int, int, int], Any] | None = ..., + progress: Callable[[int, int, int], object] | None = ..., name: str = ..., sleep: float = ..., ) -> None: ... @@ -373,7 +373,7 @@ class Cursor(Iterator[Any]): def description(self) -> tuple[tuple[str, None, None, None, None, None, None], ...] | Any: ... @property def lastrowid(self) -> int | None: ... - row_factory: Callable[[Cursor, Row], Any] | None + row_factory: Callable[[Cursor, Row], object] | None @property def rowcount(self) -> int: ... def __init__(self, __cursor: Connection) -> None: ... diff --git a/stdlib/telnetlib.pyi b/stdlib/telnetlib.pyi index 5a4326c4a48b..67ae5fcc8055 100644 --- a/stdlib/telnetlib.pyi +++ b/stdlib/telnetlib.pyi @@ -104,7 +104,7 @@ class Telnet: def read_lazy(self) -> bytes: ... def read_very_lazy(self) -> bytes: ... def read_sb_data(self) -> bytes: ... - def set_option_negotiation_callback(self, callback: Callable[[socket.socket, bytes, bytes], Any] | None) -> None: ... + def set_option_negotiation_callback(self, callback: Callable[[socket.socket, bytes, bytes], object] | None) -> None: ... def process_rawq(self) -> None: ... def rawq_getchar(self) -> bytes: ... def fill_rawq(self) -> None: ... diff --git a/stdlib/threading.pyi b/stdlib/threading.pyi index 0b0961c05c99..289a86826ecd 100644 --- a/stdlib/threading.pyi +++ b/stdlib/threading.pyi @@ -75,7 +75,7 @@ class Thread: def __init__( self, group: None = ..., - target: Callable[..., Any] | None = ..., + target: Callable[..., object] | None = ..., name: str | None = ..., args: Iterable[Any] = ..., kwargs: Mapping[str, Any] | None = ..., @@ -171,7 +171,7 @@ class Timer(Thread): def __init__( self, interval: float, - function: Callable[..., Any], + function: Callable[..., object], args: Iterable[Any] | None = ..., kwargs: Mapping[str, Any] | None = ..., ) -> None: ... diff --git a/stdlib/timeit.pyi b/stdlib/timeit.pyi index 076b2c54f991..dda6cefed0f6 100644 --- a/stdlib/timeit.pyi +++ b/stdlib/timeit.pyi @@ -5,7 +5,7 @@ from typing_extensions import TypeAlias __all__ = ["Timer", "timeit", "repeat", "default_timer"] _Timer: TypeAlias = Callable[[], float] -_Stmt: TypeAlias = str | Callable[[], Any] +_Stmt: TypeAlias = str | Callable[[], object] default_timer: _Timer @@ -16,7 +16,7 @@ class Timer: def print_exc(self, file: IO[str] | None = ...) -> None: ... def timeit(self, number: int = ...) -> float: ... def repeat(self, repeat: int = ..., number: int = ...) -> list[float]: ... - def autorange(self, callback: Callable[[int, float], Any] | None = ...) -> tuple[int, float]: ... + def autorange(self, callback: Callable[[int, float], object] | None = ...) -> tuple[int, float]: ... def timeit( stmt: _Stmt = ..., setup: _Stmt = ..., timer: _Timer = ..., number: int = ..., globals: dict[str, Any] | None = ... diff --git a/stdlib/turtle.pyi b/stdlib/turtle.pyi index cdacaf63c41f..13197c336e5e 100644 --- a/stdlib/turtle.pyi +++ b/stdlib/turtle.pyi @@ -221,10 +221,10 @@ class TurtleScreen(TurtleScreenBase): def window_height(self) -> int: ... def getcanvas(self) -> Canvas: ... def getshapes(self) -> list[str]: ... - def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ... - def onkey(self, fun: Callable[[], Any], key: str) -> None: ... + def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... + def onkey(self, fun: Callable[[], object], key: str) -> None: ... def listen(self, xdummy: float | None = ..., ydummy: float | None = ...) -> None: ... - def ontimer(self, fun: Callable[[], Any], t: int = ...) -> None: ... + def ontimer(self, fun: Callable[[], object], t: int = ...) -> None: ... @overload def bgpic(self, picname: None = ...) -> str: ... @overload @@ -238,7 +238,7 @@ class TurtleScreen(TurtleScreenBase): resetscreen = reset clearscreen = clear addshape = register_shape - def onkeypress(self, fun: Callable[[], Any], key: str | None = ...) -> None: ... + def onkeypress(self, fun: Callable[[], object], key: str | None = ...) -> None: ... onkeyrelease = onkey class TNavigator: @@ -409,9 +409,9 @@ class RawTurtle(TPen, TNavigator): def getscreen(self) -> TurtleScreen: ... def getturtle(self: Self) -> Self: ... getpen = getturtle - def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ... - def onrelease(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ... - def ondrag(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ... + def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... + def onrelease(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... + def ondrag(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... def undo(self) -> None: ... turtlesize = shapesize @@ -490,10 +490,10 @@ def window_width() -> int: ... def window_height() -> int: ... def getcanvas() -> Canvas: ... def getshapes() -> list[str]: ... -def onclick(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ... -def onkey(fun: Callable[[], Any], key: str) -> None: ... +def onclick(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... +def onkey(fun: Callable[[], object], key: str) -> None: ... def listen(xdummy: float | None = ..., ydummy: float | None = ...) -> None: ... -def ontimer(fun: Callable[[], Any], t: int = ...) -> None: ... +def ontimer(fun: Callable[[], object], t: int = ...) -> None: ... @overload def bgpic(picname: None = ...) -> str: ... @overload @@ -508,7 +508,7 @@ resetscreen = reset clearscreen = clear addshape = register_shape -def onkeypress(fun: Callable[[], Any], key: str | None = ...) -> None: ... +def onkeypress(fun: Callable[[], object], key: str | None = ...) -> None: ... onkeyrelease = onkey @@ -680,8 +680,8 @@ def getturtle() -> Turtle: ... getpen = getturtle -def onrelease(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ... -def ondrag(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ... +def onrelease(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... +def ondrag(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... def undo() -> None: ... turtlesize = shapesize diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 853b1c561857..1af4420e684d 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -571,7 +571,7 @@ def new_class( name: str, bases: Iterable[object] = ..., kwds: dict[str, Any] | None = ..., - exec_body: Callable[[dict[str, Any]], Any] | None = ..., + exec_body: Callable[[dict[str, Any]], object] | None = ..., ) -> type: ... def resolve_bases(bases: Iterable[object]) -> tuple[Any, ...]: ... def prepare_class( @@ -581,7 +581,7 @@ def prepare_class( # Actually a different type, but `property` is special and we want that too. DynamicClassAttribute = property -_Fn = TypeVar("_Fn", bound=Callable[..., Any]) +_Fn = TypeVar("_Fn", bound=Callable[..., object]) _R = TypeVar("_R") _P = ParamSpec("_P") diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 608e195707d0..980505271e66 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -874,7 +874,7 @@ if sys.version_info >= (3, 11): def assert_never(__arg: Never) -> Never: ... def assert_type(__val: _T, __typ: Any) -> _T: ... def clear_overloads() -> None: ... - def get_overloads(func: Callable[..., Any]) -> Sequence[Callable[..., Any]]: ... + def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ... def dataclass_transform( *, eq_default: bool = ..., @@ -908,7 +908,7 @@ class NamedTuple(tuple[Any, ...]): def _replace(self: TypeshedSelf, **kwargs: Any) -> TypeshedSelf: ... # Internal mypy fallback type for all typed dicts (does not exist at runtime) -class _TypedDict(Mapping[str, Any], metaclass=ABCMeta): +class _TypedDict(Mapping[str, object], metaclass=ABCMeta): def copy(self: TypeshedSelf) -> TypeshedSelf: ... # Using NoReturn so that only calls using mypy plugin hook that specialize the signature # can go through. @@ -917,7 +917,7 @@ class _TypedDict(Mapping[str, Any], metaclass=ABCMeta): def pop(self, k: NoReturn, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] def update(self: _T, __m: _T) -> None: ... def __delitem__(self, k: NoReturn) -> None: ... - def items(self) -> ItemsView[str, Any]: ... + def items(self) -> ItemsView[str, object]: ... def keys(self) -> KeysView[str]: ... def values(self) -> ValuesView[object]: ... def __or__(self: TypeshedSelf, __value: TypeshedSelf) -> TypeshedSelf: ... diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index 6b61e3bfde64..0d82ec720c25 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -120,7 +120,7 @@ Literal: _SpecialForm def IntVar(name: str) -> Any: ... # returns a new TypeVar # Internal mypy fallback type for all typed dicts (does not exist at runtime) -class _TypedDict(Mapping[str, Any], metaclass=abc.ABCMeta): +class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): __required_keys__: frozenset[str] __optional_keys__: frozenset[str] __total__: bool @@ -131,7 +131,7 @@ class _TypedDict(Mapping[str, Any], metaclass=abc.ABCMeta): # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. def pop(self, k: NoReturn, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] def update(self: _T, __m: _T) -> None: ... - def items(self) -> ItemsView[str, Any]: ... + def items(self) -> ItemsView[str, object]: ... def keys(self) -> KeysView[str]: ... def values(self) -> ValuesView[object]: ... def __delitem__(self, k: NoReturn) -> None: ... @@ -221,7 +221,7 @@ else: def assert_never(__arg: NoReturn) -> NoReturn: ... def assert_type(__val: _T, __typ: Any) -> _T: ... def clear_overloads() -> None: ... - def get_overloads(func: Callable[..., Any]) -> Sequence[Callable[..., Any]]: ... + def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ... Required: _SpecialForm NotRequired: _SpecialForm diff --git a/stdlib/unittest/case.pyi b/stdlib/unittest/case.pyi index 58d5e97f4bdb..7db217077f1b 100644 --- a/stdlib/unittest/case.pyi +++ b/stdlib/unittest/case.pyi @@ -65,7 +65,7 @@ else: ) -> bool | None: ... if sys.version_info >= (3, 8): - def addModuleCleanup(__function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addModuleCleanup(__function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... def doModuleCleanups() -> None: ... if sys.version_info >= (3, 11): @@ -156,7 +156,7 @@ class TestCase: self, expected_exception: type[BaseException] | tuple[type[BaseException], ...], expected_regex: str | bytes | Pattern[str] | Pattern[bytes], - callable: Callable[..., Any], + callable: Callable[..., object], *args: Any, **kwargs: Any, ) -> None: ... @@ -171,7 +171,7 @@ class TestCase: def assertWarns( # type: ignore[misc] self, expected_warning: type[Warning] | tuple[type[Warning], ...], - callable: Callable[_P, Any], + callable: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs, ) -> None: ... @@ -182,7 +182,7 @@ class TestCase: self, expected_warning: type[Warning] | tuple[type[Warning], ...], expected_regex: str | bytes | Pattern[str] | Pattern[bytes], - callable: Callable[_P, Any], + callable: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs, ) -> None: ... @@ -260,16 +260,16 @@ class TestCase: def assertListEqual(self, list1: list[Any], list2: list[Any], msg: Any = ...) -> None: ... def assertTupleEqual(self, tuple1: tuple[Any, ...], tuple2: tuple[Any, ...], msg: Any = ...) -> None: ... def assertSetEqual(self, set1: AbstractSet[object], set2: AbstractSet[object], msg: Any = ...) -> None: ... - def assertDictEqual(self, d1: Mapping[Any, Any], d2: Mapping[Any, Any], msg: Any = ...) -> None: ... + def assertDictEqual(self, d1: Mapping[Any, object], d2: Mapping[Any, object], msg: Any = ...) -> None: ... def fail(self, msg: Any = ...) -> NoReturn: ... def countTestCases(self) -> int: ... def defaultTestResult(self) -> unittest.result.TestResult: ... def id(self) -> str: ... def shortDescription(self) -> str | None: ... if sys.version_info >= (3, 8): - def addCleanup(self, __function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addCleanup(self, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... else: - def addCleanup(self, function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addCleanup(self, function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... if sys.version_info >= (3, 11): def enterContext(self, cm: AbstractContextManager[_T]) -> _T: ... @@ -277,7 +277,7 @@ class TestCase: def doCleanups(self) -> None: ... if sys.version_info >= (3, 8): @classmethod - def addClassCleanup(cls, __function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addClassCleanup(cls, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... @classmethod def doClassCleanups(cls) -> None: ... @@ -310,9 +310,9 @@ class TestCase: class FunctionTestCase(TestCase): def __init__( self, - testFunc: Callable[[], Any], - setUp: Callable[[], Any] | None = ..., - tearDown: Callable[[], Any] | None = ..., + testFunc: Callable[[], object], + setUp: Callable[[], object] | None = ..., + tearDown: Callable[[], object] | None = ..., description: str | None = ..., ) -> None: ... def runTest(self) -> None: ... diff --git a/stdlib/urllib/request.pyi b/stdlib/urllib/request.pyi index 27a89b1331d3..0ad10a218680 100644 --- a/stdlib/urllib/request.pyi +++ b/stdlib/urllib/request.pyi @@ -286,7 +286,7 @@ class HTTPErrorProcessor(BaseHandler): def urlretrieve( url: str, filename: StrOrBytesPath | None = ..., - reporthook: Callable[[int, int, int], Any] | None = ..., + reporthook: Callable[[int, int, int], object] | None = ..., data: _DataType = ..., ) -> tuple[str, HTTPMessage]: ... def urlcleanup() -> None: ... @@ -300,7 +300,7 @@ class URLopener: self, url: str, filename: str | None = ..., - reporthook: Callable[[int, int, int], Any] | None = ..., + reporthook: Callable[[int, int, int], object] | None = ..., data: bytes | None = ..., ) -> tuple[str, Message | None]: ... def addheader(self, *args: tuple[str, str]) -> None: ... # undocumented diff --git a/stdlib/urllib/response.pyi b/stdlib/urllib/response.pyi index 66b1cf82d1fd..8c9a600f3c48 100644 --- a/stdlib/urllib/response.pyi +++ b/stdlib/urllib/response.pyi @@ -37,9 +37,9 @@ class addbase(BinaryIO): def writelines(self, lines: Iterable[bytes]) -> None: ... class addclosehook(addbase): - closehook: Callable[..., Any] + closehook: Callable[..., object] hookargs: tuple[Any, ...] - def __init__(self, fp: IO[bytes], closehook: Callable[..., Any], *hookargs: Any) -> None: ... + def __init__(self, fp: IO[bytes], closehook: Callable[..., object], *hookargs: Any) -> None: ... class addinfo(addbase): headers: Message diff --git a/stdlib/weakref.pyi b/stdlib/weakref.pyi index 75a5b052a41b..af960391e85d 100644 --- a/stdlib/weakref.pyi +++ b/stdlib/weakref.pyi @@ -42,7 +42,7 @@ _P = ParamSpec("_P") ProxyTypes: tuple[type[Any], ...] class WeakMethod(ref[_CallableT], Generic[_CallableT]): - def __new__(cls: type[Self], meth: _CallableT, callback: Callable[[_CallableT], Any] | None = ...) -> Self: ... + def __new__(cls: type[Self], meth: _CallableT, callback: Callable[[_CallableT], object] | None = ...) -> Self: ... def __call__(self) -> _CallableT | None: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... diff --git a/stdlib/wsgiref/types.pyi b/stdlib/wsgiref/types.pyi index 7ac58343a36c..4e8f47264f3a 100644 --- a/stdlib/wsgiref/types.pyi +++ b/stdlib/wsgiref/types.pyi @@ -8,7 +8,7 @@ __all__ = ["StartResponse", "WSGIEnvironment", "WSGIApplication", "InputStream", class StartResponse(Protocol): def __call__( self, __status: str, __headers: list[tuple[str, str]], __exc_info: _OptExcInfo | None = ... - ) -> Callable[[bytes], Any]: ... + ) -> Callable[[bytes], object]: ... WSGIEnvironment: TypeAlias = dict[str, Any] WSGIApplication: TypeAlias = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] diff --git a/stdlib/xdrlib.pyi b/stdlib/xdrlib.pyi index 59282c01a3db..e0b8c6a54b00 100644 --- a/stdlib/xdrlib.pyi +++ b/stdlib/xdrlib.pyi @@ -29,9 +29,9 @@ class Packer: def pack_string(self, s: bytes) -> None: ... def pack_opaque(self, s: bytes) -> None: ... def pack_bytes(self, s: bytes) -> None: ... - def pack_list(self, list: Sequence[_T], pack_item: Callable[[_T], Any]) -> None: ... - def pack_farray(self, n: int, list: Sequence[_T], pack_item: Callable[[_T], Any]) -> None: ... - def pack_array(self, list: Sequence[_T], pack_item: Callable[[_T], Any]) -> None: ... + def pack_list(self, list: Sequence[_T], pack_item: Callable[[_T], object]) -> None: ... + def pack_farray(self, n: int, list: Sequence[_T], pack_item: Callable[[_T], object]) -> None: ... + def pack_array(self, list: Sequence[_T], pack_item: Callable[[_T], object]) -> None: ... class Unpacker: def __init__(self, data: bytes) -> None: ... diff --git a/stdlib/xml/etree/ElementTree.pyi b/stdlib/xml/etree/ElementTree.pyi index 82cd735bd829..84059bc21a87 100644 --- a/stdlib/xml/etree/ElementTree.pyi +++ b/stdlib/xml/etree/ElementTree.pyi @@ -325,7 +325,7 @@ if sys.version_info >= (3, 8): class C14NWriterTarget: def __init__( self, - write: Callable[[str], Any], + write: Callable[[str], object], *, with_comments: bool = ..., strip_text: bool = ..., diff --git a/stdlib/xmlrpc/client.pyi b/stdlib/xmlrpc/client.pyi index c1370f74e06d..7c0ba5c62fd7 100644 --- a/stdlib/xmlrpc/client.pyi +++ b/stdlib/xmlrpc/client.pyi @@ -97,7 +97,7 @@ class ExpatParser: # undocumented def feed(self, data: str | bytes) -> None: ... def close(self) -> None: ... -_WriteCallback: TypeAlias = Callable[[str], Any] +_WriteCallback: TypeAlias = Callable[[str], object] class Marshaller: # TODO: Replace 'Any' with some kind of binding diff --git a/stubs/JACK-Client/jack/__init__.pyi b/stubs/JACK-Client/jack/__init__.pyi index f6eb9c35f4ef..96b5b97b19f5 100644 --- a/stubs/JACK-Client/jack/__init__.pyi +++ b/stubs/JACK-Client/jack/__init__.pyi @@ -104,29 +104,29 @@ class Client: def transport_reposition_struct(self, position: _JackPositionT) -> None: ... # TODO def set_sync_timeout(self, timeout: int) -> None: ... def set_freewheel(self, onoff: bool) -> None: ... - def set_shutdown_callback(self, callback: Callable[[Status, str], Any]) -> None: ... - def set_process_callback(self, callback: Callable[[int], Any]) -> None: ... - def set_freewheel_callback(self, callback: Callable[[bool], Any]) -> None: ... - def set_blocksize_callback(self, callback: Callable[[int], Any]) -> None: ... - def set_samplerate_callback(self, callback: Callable[[int], Any]) -> None: ... - def set_client_registration_callback(self, callback: Callable[[str, bool], Any]) -> None: ... + def set_shutdown_callback(self, callback: Callable[[Status, str], object]) -> None: ... + def set_process_callback(self, callback: Callable[[int], object]) -> None: ... + def set_freewheel_callback(self, callback: Callable[[bool], object]) -> None: ... + def set_blocksize_callback(self, callback: Callable[[int], object]) -> None: ... + def set_samplerate_callback(self, callback: Callable[[int], object]) -> None: ... + def set_client_registration_callback(self, callback: Callable[[str, bool], object]) -> None: ... def set_port_registration_callback( - self, callback: Callable[[Port, bool], Any] | None = ..., only_available: bool = ... + self, callback: Callable[[Port, bool], object] | None = ..., only_available: bool = ... ) -> None: ... def set_port_connect_callback( - self, callback: Callable[[Port, Port, bool], Any] | None = ..., only_available: bool = ... + self, callback: Callable[[Port, Port, bool], object] | None = ..., only_available: bool = ... ) -> None: ... def set_port_rename_callback( - self, callback: Callable[[Port, str, str], Any] | None = ..., only_available: bool = ... + self, callback: Callable[[Port, str, str], object] | None = ..., only_available: bool = ... ) -> None: ... - def set_graph_order_callback(self, callback: Callable[[], Any]) -> None: ... - def set_xrun_callback(self, callback: Callable[[float], Any]) -> None: ... - def set_sync_callback(self, callback: Callable[[int, _JackPositionT], Any] | None) -> None: ... + def set_graph_order_callback(self, callback: Callable[[], object]) -> None: ... + def set_xrun_callback(self, callback: Callable[[float], object]) -> None: ... + def set_sync_callback(self, callback: Callable[[int, _JackPositionT], object] | None) -> None: ... def release_timebase(self) -> None: ... def set_timebase_callback( - self, callback: Callable[[int, int, _JackPositionT, bool], Any] | None = ..., conditional: bool = ... + self, callback: Callable[[int, int, _JackPositionT, bool], object] | None = ..., conditional: bool = ... ) -> bool: ... - def set_property_change_callback(self, callback: Callable[[int, str, int], Any]) -> None: ... + def set_property_change_callback(self, callback: Callable[[int, str, int], object]) -> None: ... def get_uuid_for_client_name(self, name: str) -> str: ... def get_client_name_by_uuid(self, uuid: str) -> str: ... def get_port_by_name(self, name: str) -> Port: ... @@ -282,6 +282,6 @@ def version() -> tuple[int, int, int, int]: ... def version_string() -> str: ... def client_name_size() -> int: ... def port_name_size() -> int: ... -def set_error_function(callback: Callable[[str], Any] | None = ...) -> None: ... -def set_info_function(callback: Callable[[str], Any] | None = ...) -> None: ... +def set_error_function(callback: Callable[[str], object] | None = ...) -> None: ... +def set_info_function(callback: Callable[[str], object] | None = ...) -> None: ... def client_pid(name: str) -> int: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi index 4612073a1d01..4e962d1eab58 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi @@ -46,8 +46,8 @@ class Dialect: @abstractmethod def create_connect_args(self, url: URL) -> None: ... def initialize(self, connection) -> None: ... - def on_connect_url(self, url) -> Callable[[DBAPIConnection], Any] | None: ... - def on_connect(self) -> Callable[[DBAPIConnection], Any] | None: ... + def on_connect_url(self, url) -> Callable[[DBAPIConnection], object] | None: ... + def on_connect(self) -> Callable[[DBAPIConnection], object] | None: ... # The following methods all raise NotImplementedError, but not all # dialects implement all methods, which is why they can't be marked # as abstract. diff --git a/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi b/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi index be2b49b62f60..7cfbf5b172eb 100644 --- a/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi +++ b/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi @@ -77,7 +77,7 @@ class AWSXRayRecorder: kwargs: dict[str, Any], name: str, namespace: str, - meta_processor: Callable[..., Any], + meta_processor: Callable[..., object], ) -> Any: ... @property def enabled(self) -> bool: ... diff --git a/stubs/boto/boto/s3/key.pyi b/stubs/boto/boto/s3/key.pyi index 92be358b985e..539f071b102f 100644 --- a/stubs/boto/boto/s3/key.pyi +++ b/stubs/boto/boto/s3/key.pyi @@ -108,7 +108,7 @@ class Key: self, fp, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], Any] | None = ..., + cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., query_args: Any | None = ..., chunked_transfer: bool = ..., @@ -121,7 +121,7 @@ class Key: fp, headers: dict[str, str] | None = ..., replace: bool = ..., - cb: Callable[[int, int], Any] | None = ..., + cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., policy: Any | None = ..., reduced_redundancy: bool = ..., @@ -133,7 +133,7 @@ class Key: fp, headers: dict[str, str] | None = ..., replace: bool = ..., - cb: Callable[[int, int], Any] | None = ..., + cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., policy: Any | None = ..., md5: Any | None = ..., @@ -148,7 +148,7 @@ class Key: filename, headers: dict[str, str] | None = ..., replace: bool = ..., - cb: Callable[[int, int], Any] | None = ..., + cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., policy: Any | None = ..., md5: Any | None = ..., @@ -160,7 +160,7 @@ class Key: string_data: str | bytes, headers: dict[str, str] | None = ..., replace: bool = ..., - cb: Callable[[int, int], Any] | None = ..., + cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., policy: Any | None = ..., md5: Any | None = ..., @@ -171,7 +171,7 @@ class Key: self, fp, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], Any] | None = ..., + cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., torrent: bool = ..., version_id: Any | None = ..., @@ -179,13 +179,13 @@ class Key: response_headers: dict[str, str] | None = ..., ): ... def get_torrent_file( - self, fp, headers: dict[str, str] | None = ..., cb: Callable[[int, int], Any] | None = ..., num_cb: int = ... + self, fp, headers: dict[str, str] | None = ..., cb: Callable[[int, int], object] | None = ..., num_cb: int = ... ): ... def get_contents_to_file( self, fp, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], Any] | None = ..., + cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., torrent: bool = ..., version_id: Any | None = ..., @@ -196,7 +196,7 @@ class Key: self, filename, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], Any] | None = ..., + cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., torrent: bool = ..., version_id: Any | None = ..., @@ -207,7 +207,7 @@ class Key: def get_contents_as_string( self, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], Any] | None = ..., + cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., torrent: bool = ..., version_id: Any | None = ..., @@ -218,7 +218,7 @@ class Key: def get_contents_as_string( self, headers: dict[str, str] | None = ..., - cb: Callable[[int, int], Any] | None = ..., + cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., torrent: bool = ..., version_id: Any | None = ..., diff --git a/stubs/fpdf2/fpdf/fpdf.pyi b/stubs/fpdf2/fpdf/fpdf.pyi index 891f51e74fbd..2c7569bb686f 100644 --- a/stubs/fpdf2/fpdf/fpdf.pyi +++ b/stubs/fpdf2/fpdf/fpdf.pyi @@ -59,7 +59,7 @@ class TitleStyle(NamedTuple): b_margin: int | None = ... class ToCPlaceholder(NamedTuple): - render_function: Callable[[FPDF, Any], Any] + render_function: Callable[[FPDF, Any], object] start_page: int y: int pages: int = ... diff --git a/stubs/gdb/gdb/__init__.pyi b/stubs/gdb/gdb/__init__.pyi index 1e9f456f354e..7c31ee7abc1e 100644 --- a/stubs/gdb/gdb/__init__.pyi +++ b/stubs/gdb/gdb/__init__.pyi @@ -31,7 +31,7 @@ def convenience_variable(__name: str) -> Value | None: ... def set_convenience_variable(__name: str, __value: _ValueOrNative | None) -> None: ... def parse_and_eval(__expression: str) -> Value: ... def find_pc_line(pc: int | Value) -> Symtab_and_line: ... -def post_event(__event: Callable[[], Any]) -> None: ... +def post_event(__event: Callable[[], object]) -> None: ... def write(string: str, stream: int = ...) -> None: ... def flush(stream: int = ...) -> None: ... def target_charset() -> str: ... @@ -357,7 +357,7 @@ class MICommand: installed: bool def __init__(self, name: str) -> None: ... - def invoke(self, arguments: list[str]) -> dict[str, Any] | None: ... + def invoke(self, arguments: list[str]) -> dict[str, object] | None: ... # Parameters @@ -641,7 +641,7 @@ class LazyString: class Architecture: def name(self) -> str: ... - def disassemble(self, start_pc: int, end_pc: int = ..., count: int = ...) -> list[dict[str, Any]]: ... + def disassemble(self, start_pc: int, end_pc: int = ..., count: int = ...) -> list[dict[str, object]]: ... def integer_type(self, size: int, signed: bool = ...) -> Type: ... def registers(self, reggroup: str = ...) -> RegisterDescriptorIterator: ... def register_groups(self) -> RegisterGroupsIterator: ... diff --git a/stubs/gdb/gdb/events.pyi b/stubs/gdb/gdb/events.pyi index 92d0f150dcc2..72d4fc503389 100644 --- a/stubs/gdb/gdb/events.pyi +++ b/stubs/gdb/gdb/events.pyi @@ -8,8 +8,8 @@ class ThreadEvent: class ContinueEvent(ThreadEvent): ... class ContinueEventRegistry: - def connect(self, __object: Callable[[ContinueEvent], Any]) -> None: ... - def disconnect(self, __object: Callable[[ContinueEvent], Any]) -> None: ... + def connect(self, __object: Callable[[ContinueEvent], object]) -> None: ... + def disconnect(self, __object: Callable[[ContinueEvent], object]) -> None: ... cont: ContinueEventRegistry @@ -18,8 +18,8 @@ class ExitedEvent: inferior: gdb.Inferior class ExitedEventRegistry: - def connect(self, __object: Callable[[ExitedEvent], Any]) -> None: ... - def disconnect(self, __object: Callable[[ExitedEvent], Any]) -> None: ... + def connect(self, __object: Callable[[ExitedEvent], object]) -> None: ... + def disconnect(self, __object: Callable[[ExitedEvent], object]) -> None: ... exited: ExitedEventRegistry @@ -31,8 +31,8 @@ class BreakpointEvent(StopEvent): breakpoint: gdb.Breakpoint class StopEventRegistry: - def connect(self, __object: Callable[[StopEvent], Any]) -> None: ... - def disconnect(self, __object: Callable[[StopEvent], Any]) -> None: ... + def connect(self, __object: Callable[[StopEvent], object]) -> None: ... + def disconnect(self, __object: Callable[[StopEvent], object]) -> None: ... stop: StopEventRegistry @@ -40,8 +40,8 @@ class NewObjFileEvent: new_objfile: gdb.Objfile class NewObjFileEventRegistry: - def connect(self, __object: Callable[[NewObjFileEvent], Any]) -> None: ... - def disconnect(self, __object: Callable[[NewObjFileEvent], Any]) -> None: ... + def connect(self, __object: Callable[[NewObjFileEvent], object]) -> None: ... + def disconnect(self, __object: Callable[[NewObjFileEvent], object]) -> None: ... new_objfile: NewObjFileEventRegistry @@ -49,8 +49,8 @@ class ClearObjFilesEvent: progspace: gdb.Progspace class ClearObjFilesEventRegistry: - def connect(self, __object: Callable[[ClearObjFilesEvent], Any]) -> None: ... - def disconnect(self, __object: Callable[[ClearObjFilesEvent], Any]) -> None: ... + def connect(self, __object: Callable[[ClearObjFilesEvent], object]) -> None: ... + def disconnect(self, __object: Callable[[ClearObjFilesEvent], object]) -> None: ... clear_objfiles: ClearObjFilesEventRegistry @@ -65,8 +65,8 @@ class InferiorCallPostEvent(InferiorCallEvent): address: gdb.Value class InferiorCallEventRegistry: - def connect(self, __object: Callable[[InferiorCallEvent], Any]) -> None: ... - def disconnect(self, __object: Callable[[InferiorCallEvent], Any]) -> None: ... + def connect(self, __object: Callable[[InferiorCallEvent], object]) -> None: ... + def disconnect(self, __object: Callable[[InferiorCallEvent], object]) -> None: ... inferior_call: InferiorCallEventRegistry @@ -75,8 +75,8 @@ class MemoryChangedEvent: length: int class MemoryChangedEventRegistry: - def connect(self, __object: Callable[[MemoryChangedEvent], Any]) -> None: ... - def disconnect(self, __object: Callable[[MemoryChangedEvent], Any]) -> None: ... + def connect(self, __object: Callable[[MemoryChangedEvent], object]) -> None: ... + def disconnect(self, __object: Callable[[MemoryChangedEvent], object]) -> None: ... memory_changed: MemoryChangedEventRegistry @@ -85,22 +85,22 @@ class RegisterChangedEvent: regnum: str class RegisterChangedEventRegistry: - def connect(self, __object: Callable[[RegisterChangedEvent], Any]) -> None: ... - def disconnect(self, __object: Callable[[RegisterChangedEvent], Any]) -> None: ... + def connect(self, __object: Callable[[RegisterChangedEvent], object]) -> None: ... + def disconnect(self, __object: Callable[[RegisterChangedEvent], object]) -> None: ... register_changed: RegisterChangedEventRegistry class BreakpointEventRegistry: - def connect(self, __object: Callable[[gdb.Breakpoint], Any]) -> None: ... - def disconnect(self, __object: Callable[[gdb.Breakpoint], Any]) -> None: ... + def connect(self, __object: Callable[[gdb.Breakpoint], object]) -> None: ... + def disconnect(self, __object: Callable[[gdb.Breakpoint], object]) -> None: ... breakpoint_created: BreakpointEventRegistry breakpoint_modified: BreakpointEventRegistry breakpoint_deleted: BreakpointEventRegistry class BeforePromptEventRegistry: - def connect(self, __object: Callable[[], Any]) -> None: ... - def disconnect(self, __object: Callable[[], Any]) -> None: ... + def connect(self, __object: Callable[[], object]) -> None: ... + def disconnect(self, __object: Callable[[], object]) -> None: ... before_prompt: BeforePromptEventRegistry @@ -108,8 +108,8 @@ class NewInferiorEvent: inferior: gdb.Inferior class NewInferiorEventRegistry: - def connect(self, __object: Callable[[NewInferiorEvent], Any]) -> None: ... - def disconnect(self, __object: Callable[[NewInferiorEvent], Any]) -> None: ... + def connect(self, __object: Callable[[NewInferiorEvent], object]) -> None: ... + def disconnect(self, __object: Callable[[NewInferiorEvent], object]) -> None: ... new_inferior: NewInferiorEventRegistry @@ -117,15 +117,15 @@ class InferiorDeletedEvent: inferior: gdb.Inferior class InferiorDeletedEventRegistry: - def connect(self, __object: Callable[[InferiorDeletedEvent], Any]) -> None: ... - def disconnect(self, __object: Callable[[InferiorDeletedEvent], Any]) -> None: ... + def connect(self, __object: Callable[[InferiorDeletedEvent], object]) -> None: ... + def disconnect(self, __object: Callable[[InferiorDeletedEvent], object]) -> None: ... inferior_deleted: InferiorDeletedEventRegistry class NewThreadEvent(ThreadEvent): ... class NewThreadEventRegistry: - def connect(self, __object: Callable[[NewThreadEvent], Any]) -> None: ... - def disconnect(self, __object: Callable[[NewThreadEvent], Any]) -> None: ... + def connect(self, __object: Callable[[NewThreadEvent], object]) -> None: ... + def disconnect(self, __object: Callable[[NewThreadEvent], object]) -> None: ... new_thread: NewThreadEventRegistry diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi index e5081b04fdec..2f77041315cb 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi @@ -80,7 +80,7 @@ class Property(ModelAttribute): required: bool | None = ..., default: object | None = ..., choices: Iterable[object] | None = ..., - validator: Callable[[Property, Any], Any] | None = ..., + validator: Callable[[Property, Any], object] | None = ..., verbose_name: str | None = ..., write_empty_list: bool | None = ..., ) -> None: ... @@ -125,7 +125,7 @@ class BlobProperty(Property): required: bool | None = ..., default: bytes | None = ..., choices: Iterable[bytes] | None = ..., - validator: Callable[[Property, Any], Any] | None = ..., + validator: Callable[[Property, Any], object] | None = ..., verbose_name: str | None = ..., write_empty_list: bool | None = ..., ) -> None: ... @@ -156,7 +156,7 @@ class JsonProperty(BlobProperty): required: bool | None = ..., default: object | None = ..., choices: Iterable[object] | None = ..., - validator: Callable[[Property, Any], Any] | None = ..., + validator: Callable[[Property, Any], object] | None = ..., verbose_name: str | None = ..., write_empty_list: bool | None = ..., ) -> None: ... @@ -182,7 +182,7 @@ class UserProperty(Property): required: bool | None = ..., default: bytes | None = ..., choices: Iterable[bytes] | None = ..., - validator: Callable[[Property, Any], Any] | None = ..., + validator: Callable[[Property, Any], object] | None = ..., verbose_name: str | None = ..., write_empty_list: bool | None = ..., ) -> None: ... @@ -216,7 +216,7 @@ class DateTimeProperty(Property): required: bool | None = ..., default: datetime.datetime | None = ..., choices: Iterable[datetime.datetime] | None = ..., - validator: Callable[[Property, Any], Any] | None = ..., + validator: Callable[[Property, Any], object] | None = ..., verbose_name: str | None = ..., write_empty_list: bool | None = ..., ) -> None: ... @@ -238,7 +238,7 @@ class GenericProperty(Property): class ComputedProperty(GenericProperty): def __init__( self, - func: Callable[[Model], Any], + func: Callable[[Model], object], name: str | None = ..., indexed: bool | None = ..., repeated: bool | None = ..., @@ -399,8 +399,8 @@ class Model(_NotEqualMixin, metaclass=MetaModel): def has_complete_key(self) -> bool: ... def to_dict( self, - include: list[object] | tuple[object, Any] | set[object] | None = ..., - exclude: list[object] | tuple[object, Any] | set[object] | None = ..., + include: list[object] | tuple[object, object] | set[object] | None = ..., + exclude: list[object] | tuple[object, object] | set[object] | None = ..., ): ... class Expando(Model): diff --git a/stubs/invoke/invoke/util.pyi b/stubs/invoke/invoke/util.pyi index 7b08fef8e188..d010b60300cc 100644 --- a/stubs/invoke/invoke/util.pyi +++ b/stubs/invoke/invoke/util.pyi @@ -16,14 +16,14 @@ def cd(where: str) -> AbstractContextManager[None]: ... def has_fileno(stream) -> bool: ... def isatty(stream) -> bool: ... def encode_output(string: str, encoding: str) -> str: ... -def helpline(obj: Callable[..., Any]) -> str | None: ... +def helpline(obj: Callable[..., object]) -> str | None: ... class ExceptionHandlingThread(threading.Thread): def __init__( self, *, group: None = ..., - target: Callable[..., Any] | None = ..., + target: Callable[..., object] | None = ..., name: str | None = ..., args: Iterable[Any] = ..., kwargs: Mapping[str, Any] | None = ..., diff --git a/stubs/opentracing/opentracing/harness/scope_check.pyi b/stubs/opentracing/opentracing/harness/scope_check.pyi index c03595c563c5..10b5ce11d39e 100644 --- a/stubs/opentracing/opentracing/harness/scope_check.pyi +++ b/stubs/opentracing/opentracing/harness/scope_check.pyi @@ -4,7 +4,7 @@ from ..scope_manager import ScopeManager class ScopeCompatibilityCheckMixin: def scope_manager(self) -> ScopeManager: ... - def run_test(self, test_fn: Callable[[], Any]) -> None: ... + def run_test(self, test_fn: Callable[[], object]) -> None: ... def test_missing_active_external(self) -> None: ... def test_missing_active(self) -> None: ... def test_activate(self) -> None: ... diff --git a/stubs/paramiko/paramiko/channel.pyi b/stubs/paramiko/paramiko/channel.pyi index 46d8cbc3e624..f88d5c753e3e 100644 --- a/stubs/paramiko/paramiko/channel.pyi +++ b/stubs/paramiko/paramiko/channel.pyi @@ -60,9 +60,9 @@ class Channel(ClosingContextManager): auth_protocol: str | bytes | None = ..., auth_cookie: str | bytes | None = ..., single_connection: bool = ..., - handler: Callable[[Channel, tuple[str, int]], Any] | None = ..., + handler: Callable[[Channel, tuple[str, int]], object] | None = ..., ) -> bytes: ... - def request_forward_agent(self, handler: Callable[[Channel], Any]) -> bool: ... + def request_forward_agent(self, handler: Callable[[Channel], object]) -> bool: ... def get_transport(self) -> Transport: ... def set_name(self, name: str) -> None: ... def get_name(self) -> str: ... diff --git a/stubs/paramiko/paramiko/dsskey.pyi b/stubs/paramiko/paramiko/dsskey.pyi index 05f95eef58f6..f98c69f5191e 100644 --- a/stubs/paramiko/paramiko/dsskey.pyi +++ b/stubs/paramiko/paramiko/dsskey.pyi @@ -31,4 +31,4 @@ class DSSKey(PKey): def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ... def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ... @staticmethod - def generate(bits: int = ..., progress_func: Callable[..., Any] | None = ...) -> DSSKey: ... + def generate(bits: int = ..., progress_func: Callable[..., object] | None = ...) -> DSSKey: ... diff --git a/stubs/paramiko/paramiko/ecdsakey.pyi b/stubs/paramiko/paramiko/ecdsakey.pyi index 7eae8ef2219d..e5ff63c6b9ca 100644 --- a/stubs/paramiko/paramiko/ecdsakey.pyi +++ b/stubs/paramiko/paramiko/ecdsakey.pyi @@ -50,5 +50,5 @@ class ECDSAKey(PKey): def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ... @classmethod def generate( - cls, curve: EllipticCurve = ..., progress_func: Callable[..., Any] | None = ..., bits: int | None = ... + cls, curve: EllipticCurve = ..., progress_func: Callable[..., object] | None = ..., bits: int | None = ... ) -> ECDSAKey: ... diff --git a/stubs/paramiko/paramiko/packet.pyi b/stubs/paramiko/paramiko/packet.pyi index 2396c458d789..f7e62d8536a2 100644 --- a/stubs/paramiko/paramiko/packet.pyi +++ b/stubs/paramiko/paramiko/packet.pyi @@ -44,7 +44,7 @@ class Packetizer: def get_mac_size_in(self) -> int: ... def get_mac_size_out(self) -> int: ... def need_rekey(self) -> bool: ... - def set_keepalive(self, interval: int, callback: Callable[[], Any]) -> None: ... + def set_keepalive(self, interval: int, callback: Callable[[], object]) -> None: ... def read_timer(self) -> None: ... def start_handshake(self, timeout: float) -> None: ... def handshake_timed_out(self) -> bool: ... diff --git a/stubs/paramiko/paramiko/rsakey.pyi b/stubs/paramiko/paramiko/rsakey.pyi index b1c185b117cf..477ac328ab77 100644 --- a/stubs/paramiko/paramiko/rsakey.pyi +++ b/stubs/paramiko/paramiko/rsakey.pyi @@ -31,4 +31,4 @@ class RSAKey(PKey): def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ... def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ... @staticmethod - def generate(bits: int, progress_func: Callable[..., Any] | None = ...) -> RSAKey: ... + def generate(bits: int, progress_func: Callable[..., object] | None = ...) -> RSAKey: ... diff --git a/stubs/paramiko/paramiko/sftp_client.pyi b/stubs/paramiko/paramiko/sftp_client.pyi index 83b089225a5d..ebaa92cb7ca4 100644 --- a/stubs/paramiko/paramiko/sftp_client.pyi +++ b/stubs/paramiko/paramiko/sftp_client.pyi @@ -11,7 +11,7 @@ from paramiko.sftp_file import SFTPFile from paramiko.transport import Transport from paramiko.util import ClosingContextManager -_Callback: TypeAlias = Callable[[int, int], Any] +_Callback: TypeAlias = Callable[[int, int], object] b_slash: bytes diff --git a/stubs/paramiko/paramiko/transport.pyi b/stubs/paramiko/paramiko/transport.pyi index 16b7f575cfa9..efaacd9e7f9e 100644 --- a/stubs/paramiko/paramiko/transport.pyi +++ b/stubs/paramiko/paramiko/transport.pyi @@ -120,7 +120,7 @@ class Transport(Thread, ClosingContextManager): timeout: float | None = ..., ) -> Channel: ... def request_port_forward( - self, address: str, port: int, handler: Callable[[Channel, _Addr, _Addr], Any] | None = ... + self, address: str, port: int, handler: Callable[[Channel, _Addr, _Addr], object] | None = ... ) -> int: ... def cancel_port_forward(self, address: str, port: int) -> None: ... def open_sftp_client(self) -> SFTPClient | None: ... diff --git a/stubs/prettytable/prettytable/colortable.pyi b/stubs/prettytable/prettytable/colortable.pyi index 088dea79a8ba..1cb3fc8bb60d 100644 --- a/stubs/prettytable/prettytable/colortable.pyi +++ b/stubs/prettytable/prettytable/colortable.pyi @@ -6,7 +6,7 @@ from .prettytable import PrettyTable RESET_CODE: str -init: Callable[[], Any] +init: Callable[[], object] class Theme: default_color: str diff --git a/stubs/psutil/psutil/__init__.pyi b/stubs/psutil/psutil/__init__.pyi index 4240bd9ed11b..868dc1b66171 100644 --- a/stubs/psutil/psutil/__init__.pyi +++ b/stubs/psutil/psutil/__init__.pyi @@ -194,7 +194,7 @@ def process_iter( attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ... ) -> Iterator[Process]: ... def wait_procs( - procs: Iterable[Process], timeout: float | None = ..., callback: Callable[[Process], Any] | None = ... + procs: Iterable[Process], timeout: float | None = ..., callback: Callable[[Process], object] | None = ... ) -> tuple[list[Process], list[Process]]: ... def cpu_count(logical: bool = ...) -> int: ... def cpu_times(percpu: bool = ...): ... diff --git a/stubs/pyOpenSSL/OpenSSL/SSL.pyi b/stubs/pyOpenSSL/OpenSSL/SSL.pyi index a66ece4a8bd3..9881f91156e8 100644 --- a/stubs/pyOpenSSL/OpenSSL/SSL.pyi +++ b/stubs/pyOpenSSL/OpenSSL/SSL.pyi @@ -193,7 +193,7 @@ class Context: def use_privatekey(self, pkey: PKey) -> None: ... def add_extra_chain_cert(self, certobj: X509) -> None: ... def set_cipher_list(self, cipher_list: bytes) -> None: ... - def set_keylog_callback(self, callback: Callable[[Connection, bytes], Any]) -> None: ... + def set_keylog_callback(self, callback: Callable[[Connection, bytes], object]) -> None: ... def set_alpn_protos(self, protos: Sequence[bytes]) -> None: ... def set_alpn_select_callback(self, callback: Callable[[Connection, list[bytes]], bytes]) -> None: ... def set_ocsp_server_callback(self, callback: Callable[[Connection, _T | None], bytes], data: _T | None = ...) -> None: ... diff --git a/stubs/pynput/pynput/_util.pyi b/stubs/pynput/pynput/_util.pyi index eb1ebe2a02ea..4202bcb5464e 100644 --- a/stubs/pynput/pynput/_util.pyi +++ b/stubs/pynput/pynput/_util.pyi @@ -67,6 +67,6 @@ class Events(Generic[_T, _AbstractListener_T]): def __iter__(self: Self) -> Self: ... def __next__(self) -> _T: ... def get(self, timeout: float | None = ...) -> _T | None: ... - def _event_mapper(self, event: Callable[_P, Any]) -> Callable[_P, None]: ... + def _event_mapper(self, event: Callable[_P, object]) -> Callable[_P, None]: ... class NotifierMixin: ... diff --git a/stubs/pynput/pynput/keyboard/__init__.pyi b/stubs/pynput/pynput/keyboard/__init__.pyi index 5d29819c9040..7add8545394f 100644 --- a/stubs/pynput/pynput/keyboard/__init__.pyi +++ b/stubs/pynput/pynput/keyboard/__init__.pyi @@ -20,7 +20,7 @@ class Events(_util.Events[Any, Listener]): def get(self, timeout: float | None = ...) -> Press | Release | None: ... class HotKey: - def __init__(self, keys: list[KeyCode], on_activate: Callable[[], Any]) -> None: ... + def __init__(self, keys: list[KeyCode], on_activate: Callable[[], object]) -> None: ... @staticmethod def parse(keys: str) -> list[KeyCode]: ... def press(self, key: Key | KeyCode) -> None: ... diff --git a/stubs/pysftp/pysftp/__init__.pyi b/stubs/pysftp/pysftp/__init__.pyi index 36f3a322d1f1..89d52ead34bd 100644 --- a/stubs/pysftp/pysftp/__init__.pyi +++ b/stubs/pysftp/pysftp/__init__.pyi @@ -33,7 +33,7 @@ class CnOpts: def __init__(self, knownhosts: str | None = ...) -> None: ... def get_hostkey(self, host: str) -> paramiko.PKey: ... -_Callback: TypeAlias = Callable[[int, int], Any] +_Callback: TypeAlias = Callable[[int, int], object] _Path: TypeAlias = str | bytes class Connection: diff --git a/stubs/pysftp/pysftp/helpers.pyi b/stubs/pysftp/pysftp/helpers.pyi index 6ded37e47feb..f792cd3e13c1 100644 --- a/stubs/pysftp/pysftp/helpers.pyi +++ b/stubs/pysftp/pysftp/helpers.pyi @@ -27,7 +27,7 @@ def path_advance(thepath: str, sep: str = ...) -> Iterator[str]: ... def path_retreat(thepath: str, sep: str = ...) -> Iterator[str]: ... def reparent(newparent: str, oldpath: str) -> str: ... -_PathCallback: TypeAlias = Callable[[str], Any] +_PathCallback: TypeAlias = Callable[[str], object] def walktree( localpath: str, fcallback: _PathCallback, dcallback: _PathCallback, ucallback: _PathCallback, recurse: bool = ... diff --git a/stubs/python-nmap/nmap/nmap.pyi b/stubs/python-nmap/nmap/nmap.pyi index 23b471acacfc..4b7aa0591dad 100644 --- a/stubs/python-nmap/nmap/nmap.pyi +++ b/stubs/python-nmap/nmap/nmap.pyi @@ -3,7 +3,7 @@ from typing import Any, TypeVar from typing_extensions import TypeAlias, TypedDict _T = TypeVar("_T") -_Callback: TypeAlias = Callable[[str, _Result], Any] +_Callback: TypeAlias = Callable[[str, _Result], object] class _Result(TypedDict): nmap: _ResultNmap diff --git a/stubs/redis/redis/asyncio/connection.pyi b/stubs/redis/redis/asyncio/connection.pyi index 1cc9ebd7897c..84fdaa23cc7b 100644 --- a/stubs/redis/redis/asyncio/connection.pyi +++ b/stubs/redis/redis/asyncio/connection.pyi @@ -247,7 +247,7 @@ FALSE_STRINGS: Any def to_bool(value) -> bool | None: ... -URL_QUERY_ARGUMENT_PARSERS: Mapping[str, Callable[..., Any]] +URL_QUERY_ARGUMENT_PARSERS: Mapping[str, Callable[..., object]] class ConnectKwargs(TypedDict): username: str diff --git a/stubs/redis/redis/connection.pyi b/stubs/redis/redis/connection.pyi index 31bec75689a2..88237fb0105e 100644 --- a/stubs/redis/redis/connection.pyi +++ b/stubs/redis/redis/connection.pyi @@ -25,7 +25,7 @@ URL_QUERY_ARGUMENT_PARSERS: dict[str, Callable[[Any], Any]] # Options as passed to Pool.get_connection(). _ConnectionPoolOptions: TypeAlias = Any -_ConnectFunc: TypeAlias = Callable[[Connection], Any] +_ConnectFunc: TypeAlias = Callable[[Connection], object] class BaseParser: EXCEPTION_CLASSES: ClassVar[dict[str, type[Exception] | dict[str, type[Exception]]]] diff --git a/stubs/redis/redis/retry.pyi b/stubs/redis/redis/retry.pyi index a2ca37acb3a8..ec20224e8756 100644 --- a/stubs/redis/redis/retry.pyi +++ b/stubs/redis/redis/retry.pyi @@ -8,4 +8,4 @@ _T = TypeVar("_T") class Retry: def __init__(self, backoff: AbstractBackoff, retries: int, supported_errors: tuple[type[Exception], ...] = ...) -> None: ... def update_supported_errors(self, specified_errors: Iterable[type[Exception]]) -> None: ... - def call_with_retry(self, do: Callable[[], _T], fail: Callable[[Exception], Any]) -> _T: ... + def call_with_retry(self, do: Callable[[], _T], fail: Callable[[Exception], object]) -> _T: ... diff --git a/stubs/setuptools/pkg_resources/__init__.pyi b/stubs/setuptools/pkg_resources/__init__.pyi index 38f0d68eb228..ceac29f7d60e 100644 --- a/stubs/setuptools/pkg_resources/__init__.pyi +++ b/stubs/setuptools/pkg_resources/__init__.pyi @@ -36,7 +36,7 @@ class WorkingSet: self, requirements: Iterable[Requirement], env: Environment | None = ..., installer: _InstallerType | None = ... ) -> list[Distribution]: ... def add(self, dist: Distribution, entry: str | None = ..., insert: bool = ..., replace: bool = ...) -> None: ... - def subscribe(self, callback: Callable[[Distribution], Any]) -> None: ... + def subscribe(self, callback: Callable[[Distribution], object]) -> None: ... def find_plugins( self, plugin_env: Environment, full_env: Environment | None = ..., fallback: bool = ... ) -> tuple[list[Distribution], dict[Distribution, Exception]]: ... diff --git a/stubs/setuptools/setuptools/_distutils/ccompiler.pyi b/stubs/setuptools/setuptools/_distutils/ccompiler.pyi index df5963be2828..5b92c5f5c42e 100644 --- a/stubs/setuptools/setuptools/_distutils/ccompiler.pyi +++ b/stubs/setuptools/setuptools/_distutils/ccompiler.pyi @@ -143,7 +143,7 @@ class CCompiler: def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ... def object_filenames(self, source_filenames: list[str], strip_dir: int = ..., output_dir: str = ...) -> list[str]: ... def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... - def execute(self, func: Callable[..., Any], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ... + def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ... def spawn(self, cmd: list[str]) -> None: ... def mkpath(self, name: str, mode: int = ...) -> None: ... def move_file(self, src: str, dst: str) -> str: ... diff --git a/stubs/setuptools/setuptools/_distutils/cmd.pyi b/stubs/setuptools/setuptools/_distutils/cmd.pyi index 8163ae78fd8f..e706bdbc5802 100644 --- a/stubs/setuptools/setuptools/_distutils/cmd.pyi +++ b/stubs/setuptools/setuptools/_distutils/cmd.pyi @@ -25,7 +25,7 @@ class Command: def run_command(self, command: str) -> None: ... def get_sub_commands(self) -> list[str]: ... def warn(self, msg: str) -> None: ... - def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ... + def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ... def mkpath(self, name: str, mode: int = ...) -> None: ... def copy_file( self, @@ -60,7 +60,7 @@ class Command: self, infiles: str | list[str] | tuple[str, ...], outfile: str, - func: Callable[..., Any], + func: Callable[..., object], args: list[Any], exec_msg: str | None = ..., skip_msg: str | None = ..., diff --git a/stubs/setuptools/setuptools/_distutils/util.pyi b/stubs/setuptools/setuptools/_distutils/util.pyi index 099586141694..6790712ffe25 100644 --- a/stubs/setuptools/setuptools/_distutils/util.pyi +++ b/stubs/setuptools/setuptools/_distutils/util.pyi @@ -14,7 +14,7 @@ def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... def grok_environment_error(exc: object, prefix: str = ...) -> str: ... def split_quoted(s: str) -> list[str]: ... def execute( - func: Callable[..., Any], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ... + func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ... ) -> None: ... def strtobool(val: str) -> Literal[0, 1]: ... def byte_compile( diff --git a/stubs/six/six/__init__.pyi b/stubs/six/six/__init__.pyi index 1c3f99c87c92..7a084b3cc661 100644 --- a/stubs/six/six/__init__.pyi +++ b/stubs/six/six/__init__.pyi @@ -72,7 +72,7 @@ def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Itera @overload def assertRaisesRegex(self: unittest.TestCase, msg: str | None = ...) -> Any: ... @overload -def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... +def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., object], *args: Any, **kwargs: Any) -> Any: ... def assertRegex( self: unittest.TestCase, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: str | None = ... ) -> None: ... diff --git a/stubs/tqdm/tqdm/utils.pyi b/stubs/tqdm/tqdm/utils.pyi index afbc0e57982f..3055987cd92a 100644 --- a/stubs/tqdm/tqdm/utils.pyi +++ b/stubs/tqdm/tqdm/utils.pyi @@ -49,7 +49,7 @@ class DisableOnWriteError(ObjectWrapper): def __eq__(self, other: object) -> bool: ... class CallbackIOWrapper(ObjectWrapper): - def __init__(self, callback: Callable[[int], Any], stream, method: str = ...) -> None: ... + def __init__(self, callback: Callable[[int], object], stream, method: str = ...) -> None: ... def disp_len(data: str) -> int: ... def disp_trim(data: str, length: int) -> str: ... diff --git a/stubs/waitress/waitress/runner.pyi b/stubs/waitress/waitress/runner.pyi index d7027001d345..aeced93f4d9e 100644 --- a/stubs/waitress/waitress/runner.pyi +++ b/stubs/waitress/waitress/runner.pyi @@ -10,4 +10,4 @@ def match(obj_name: str) -> tuple[str, str]: ... def resolve(module_name: str, object_name: str) -> Any: ... def show_help(stream: TextIOWrapper, name: str, error: str | None = ...) -> None: ... def show_exception(stream: TextIOWrapper) -> None: ... -def run(argv: Sequence[str] = ..., _serve: Callable[..., Any] = ...) -> None: ... +def run(argv: Sequence[str] = ..., _serve: Callable[..., object] = ...) -> None: ... diff --git a/stubs/waitress/waitress/trigger.pyi b/stubs/waitress/waitress/trigger.pyi index b9d9e28f5fba..0908963bab23 100644 --- a/stubs/waitress/waitress/trigger.pyi +++ b/stubs/waitress/waitress/trigger.pyi @@ -16,7 +16,7 @@ class _triggerbase: def handle_connect(self) -> None: ... def handle_close(self) -> None: ... def close(self) -> None: ... - def pull_trigger(self, thunk: Callable[[None], Any] | None = ...) -> None: ... + def pull_trigger(self, thunk: Callable[[None], object] | None = ...) -> None: ... def handle_read(self) -> None: ... if sys.platform == "linux" or sys.platform == "darwin": From d942921db006956913b7c905345653c017cde69f Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Mon, 25 Jul 2022 14:42:12 -0700 Subject: [PATCH 3/4] Use Callable[..., Any] instead of Callable[..., object] for unittest --- stdlib/doctest.pyi | 4 ++-- stdlib/unittest/case.pyi | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/stdlib/doctest.pyi b/stdlib/doctest.pyi index 6bb1bf9d33c5..c0672cde8461 100644 --- a/stdlib/doctest.pyi +++ b/stdlib/doctest.pyi @@ -201,8 +201,8 @@ class DocTestCase(unittest.TestCase): self, test: DocTest, optionflags: int = ..., - setUp: Callable[[DocTest], object] | None = ..., - tearDown: Callable[[DocTest], object] | None = ..., + setUp: Callable[[DocTest], Any] | None = ..., + tearDown: Callable[[DocTest], Any] | None = ..., checker: OutputChecker | None = ..., ) -> None: ... def setUp(self) -> None: ... diff --git a/stdlib/unittest/case.pyi b/stdlib/unittest/case.pyi index 7db217077f1b..58d5e97f4bdb 100644 --- a/stdlib/unittest/case.pyi +++ b/stdlib/unittest/case.pyi @@ -65,7 +65,7 @@ else: ) -> bool | None: ... if sys.version_info >= (3, 8): - def addModuleCleanup(__function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addModuleCleanup(__function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... def doModuleCleanups() -> None: ... if sys.version_info >= (3, 11): @@ -156,7 +156,7 @@ class TestCase: self, expected_exception: type[BaseException] | tuple[type[BaseException], ...], expected_regex: str | bytes | Pattern[str] | Pattern[bytes], - callable: Callable[..., object], + callable: Callable[..., Any], *args: Any, **kwargs: Any, ) -> None: ... @@ -171,7 +171,7 @@ class TestCase: def assertWarns( # type: ignore[misc] self, expected_warning: type[Warning] | tuple[type[Warning], ...], - callable: Callable[_P, object], + callable: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs, ) -> None: ... @@ -182,7 +182,7 @@ class TestCase: self, expected_warning: type[Warning] | tuple[type[Warning], ...], expected_regex: str | bytes | Pattern[str] | Pattern[bytes], - callable: Callable[_P, object], + callable: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs, ) -> None: ... @@ -260,16 +260,16 @@ class TestCase: def assertListEqual(self, list1: list[Any], list2: list[Any], msg: Any = ...) -> None: ... def assertTupleEqual(self, tuple1: tuple[Any, ...], tuple2: tuple[Any, ...], msg: Any = ...) -> None: ... def assertSetEqual(self, set1: AbstractSet[object], set2: AbstractSet[object], msg: Any = ...) -> None: ... - def assertDictEqual(self, d1: Mapping[Any, object], d2: Mapping[Any, object], msg: Any = ...) -> None: ... + def assertDictEqual(self, d1: Mapping[Any, Any], d2: Mapping[Any, Any], msg: Any = ...) -> None: ... def fail(self, msg: Any = ...) -> NoReturn: ... def countTestCases(self) -> int: ... def defaultTestResult(self) -> unittest.result.TestResult: ... def id(self) -> str: ... def shortDescription(self) -> str | None: ... if sys.version_info >= (3, 8): - def addCleanup(self, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addCleanup(self, __function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... else: - def addCleanup(self, function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addCleanup(self, function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... if sys.version_info >= (3, 11): def enterContext(self, cm: AbstractContextManager[_T]) -> _T: ... @@ -277,7 +277,7 @@ class TestCase: def doCleanups(self) -> None: ... if sys.version_info >= (3, 8): @classmethod - def addClassCleanup(cls, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addClassCleanup(cls, __function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... @classmethod def doClassCleanups(cls) -> None: ... @@ -310,9 +310,9 @@ class TestCase: class FunctionTestCase(TestCase): def __init__( self, - testFunc: Callable[[], object], - setUp: Callable[[], object] | None = ..., - tearDown: Callable[[], object] | None = ..., + testFunc: Callable[[], Any], + setUp: Callable[[], Any] | None = ..., + tearDown: Callable[[], Any] | None = ..., description: str | None = ..., ) -> None: ... def runTest(self) -> None: ... From bc138727a0d3b4965edbc6f831c8f2f0119b9e06 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Mon, 25 Jul 2022 14:49:43 -0700 Subject: [PATCH 4/4] remove errant Mapping change --- stdlib/unittest/case.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/unittest/case.pyi b/stdlib/unittest/case.pyi index 58d5e97f4bdb..6d34eda310a8 100644 --- a/stdlib/unittest/case.pyi +++ b/stdlib/unittest/case.pyi @@ -260,7 +260,7 @@ class TestCase: def assertListEqual(self, list1: list[Any], list2: list[Any], msg: Any = ...) -> None: ... def assertTupleEqual(self, tuple1: tuple[Any, ...], tuple2: tuple[Any, ...], msg: Any = ...) -> None: ... def assertSetEqual(self, set1: AbstractSet[object], set2: AbstractSet[object], msg: Any = ...) -> None: ... - def assertDictEqual(self, d1: Mapping[Any, Any], d2: Mapping[Any, Any], msg: Any = ...) -> None: ... + def assertDictEqual(self, d1: Mapping[Any, object], d2: Mapping[Any, object], msg: Any = ...) -> None: ... def fail(self, msg: Any = ...) -> NoReturn: ... def countTestCases(self) -> int: ... def defaultTestResult(self) -> unittest.result.TestResult: ...