Skip to content

Commit 8ef6602

Browse files
authored
Third-party stubs: audit more Callable[<parameters>, Any] annotations (#8233)
1 parent fb478f0 commit 8ef6602

File tree

12 files changed

+17
-18
lines changed

12 files changed

+17
-18
lines changed

stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class AWSXRayRecorder:
7777
kwargs: dict[str, Any],
7878
name: str,
7979
namespace: str,
80-
meta_processor: Callable[..., Any],
80+
meta_processor: Callable[..., object],
8181
) -> Any: ...
8282
@property
8383
def enabled(self) -> bool: ...

stubs/invoke/invoke/util.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ def cd(where: str) -> AbstractContextManager[None]: ...
1616
def has_fileno(stream) -> bool: ...
1717
def isatty(stream) -> bool: ...
1818
def encode_output(string: str, encoding: str) -> str: ...
19-
def helpline(obj: Callable[..., Any]) -> str | None: ...
19+
def helpline(obj: Callable[..., object]) -> str | None: ...
2020

2121
class ExceptionHandlingThread(threading.Thread):
2222
def __init__(
2323
self,
2424
*,
2525
group: None = ...,
26-
target: Callable[..., Any] | None = ...,
26+
target: Callable[..., object] | None = ...,
2727
name: str | None = ...,
2828
args: Iterable[Any] = ...,
2929
kwargs: Mapping[str, Any] | None = ...,

stubs/opentracing/opentracing/harness/scope_check.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from collections.abc import Callable
2-
from typing import Any
32

43
from ..scope_manager import ScopeManager
54

65
class ScopeCompatibilityCheckMixin:
76
def scope_manager(self) -> ScopeManager: ...
8-
def run_test(self, test_fn: Callable[[Any], Any]) -> None: ...
7+
def run_test(self, test_fn: Callable[[], object]) -> None: ...
98
def test_missing_active_external(self) -> None: ...
109
def test_missing_active(self) -> None: ...
1110
def test_activate(self) -> None: ...

stubs/paramiko/paramiko/dsskey.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections.abc import Callable
2-
from typing import IO, Any
2+
from typing import IO
33

44
from paramiko.message import Message
55
from paramiko.pkey import PKey
@@ -31,4 +31,4 @@ class DSSKey(PKey):
3131
def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ...
3232
def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ...
3333
@staticmethod
34-
def generate(bits: int = ..., progress_func: Callable[..., Any] | None = ...) -> DSSKey: ...
34+
def generate(bits: int = ..., progress_func: Callable[..., object] | None = ...) -> DSSKey: ...

stubs/paramiko/paramiko/ecdsakey.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ class ECDSAKey(PKey):
5050
def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ...
5151
@classmethod
5252
def generate(
53-
cls, curve: EllipticCurve = ..., progress_func: Callable[..., Any] | None = ..., bits: int | None = ...
53+
cls, curve: EllipticCurve = ..., progress_func: Callable[..., object] | None = ..., bits: int | None = ...
5454
) -> ECDSAKey: ...

stubs/paramiko/paramiko/rsakey.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections.abc import Callable
2-
from typing import IO, Any
2+
from typing import IO
33

44
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPublicKey, RSAPublicNumbers
55
from paramiko.message import Message
@@ -31,4 +31,4 @@ class RSAKey(PKey):
3131
def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ...
3232
def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ...
3333
@staticmethod
34-
def generate(bits: int, progress_func: Callable[..., Any] | None = ...) -> RSAKey: ...
34+
def generate(bits: int, progress_func: Callable[..., object] | None = ...) -> RSAKey: ...

stubs/paramiko/paramiko/sftp_client.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from _typeshed import Self
22
from collections.abc import Callable, Iterator
33
from logging import Logger
4-
from typing import IO, Any
4+
from typing import IO
55
from typing_extensions import TypeAlias
66

77
from paramiko.channel import Channel
@@ -11,7 +11,7 @@ from paramiko.sftp_file import SFTPFile
1111
from paramiko.transport import Transport
1212
from paramiko.util import ClosingContextManager
1313

14-
_Callback: TypeAlias = Callable[[int, int], Any]
14+
_Callback: TypeAlias = Callable[[int, int], object]
1515

1616
b_slash: bytes
1717

stubs/psutil/psutil/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def process_iter(
195195
attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ...
196196
) -> Iterator[Process]: ...
197197
def wait_procs(
198-
procs: Iterable[Process], timeout: float | None = ..., callback: Callable[[Process], Any] | None = ...
198+
procs: Iterable[Process], timeout: float | None = ..., callback: Callable[[Process], object] | None = ...
199199
) -> tuple[list[Process], list[Process]]: ...
200200
def cpu_count(logical: bool = ...) -> int: ...
201201
def cpu_times(percpu: bool = ...): ...

stubs/pysftp/pysftp/__init__.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ from collections.abc import Callable, Sequence
33
from contextlib import AbstractContextManager
44
from stat import S_IMODE as S_IMODE
55
from types import TracebackType
6-
from typing import IO, Any
6+
from typing import IO
77
from typing_extensions import Literal, TypeAlias
88

99
import paramiko
@@ -33,7 +33,7 @@ class CnOpts:
3333
def __init__(self, knownhosts: str | None = ...) -> None: ...
3434
def get_hostkey(self, host: str) -> paramiko.PKey: ...
3535

36-
_Callback: TypeAlias = Callable[[int, int], Any]
36+
_Callback: TypeAlias = Callable[[int, int], object]
3737
_Path: TypeAlias = str | bytes
3838

3939
class Connection:

stubs/python-nmap/nmap/nmap.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ from typing import Any, TypeVar
33
from typing_extensions import TypeAlias, TypedDict
44

55
_T = TypeVar("_T")
6-
_Callback: TypeAlias = Callable[[str, _Result], Any]
6+
_Callback: TypeAlias = Callable[[str, _Result], object]
77

88
class _Result(TypedDict):
99
nmap: _ResultNmap

stubs/six/six/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Itera
7171
@overload
7272
def assertRaisesRegex(self: unittest.TestCase, msg: str | None = ...) -> Any: ...
7373
@overload
74-
def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ...
74+
def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., object], *args: Any, **kwargs: Any) -> Any: ...
7575
def assertRegex(
7676
self: unittest.TestCase, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: str | None = ...
7777
) -> None: ...

stubs/waitress/waitress/runner.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ def match(obj_name: str) -> tuple[str, str]: ...
99
def resolve(module_name: str, object_name: str) -> Any: ...
1010
def show_help(stream: TextIOWrapper, name: str, error: str | None = ...) -> None: ...
1111
def show_exception(stream: TextIOWrapper) -> None: ...
12-
def run(argv: Sequence[str] = ..., _serve: Callable[..., Any] = ...) -> None: ...
12+
def run(argv: Sequence[str] = ..., _serve: Callable[..., object] = ...) -> None: ...

0 commit comments

Comments
 (0)