mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Third-party stubs: audit more Callable[<parameters>, Any] annotations (#8233)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
@@ -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 = ...,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
from ..scope_manager import ScopeManager
|
||||
|
||||
class ScopeCompatibilityCheckMixin:
|
||||
def scope_manager(self) -> ScopeManager: ...
|
||||
def run_test(self, test_fn: Callable[[Any], 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: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from collections.abc import Callable
|
||||
from typing import IO, Any
|
||||
from typing import IO
|
||||
|
||||
from paramiko.message import Message
|
||||
from paramiko.pkey import PKey
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from collections.abc import Callable
|
||||
from typing import IO, Any
|
||||
from typing import IO
|
||||
|
||||
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPublicKey, RSAPublicNumbers
|
||||
from paramiko.message import Message
|
||||
@@ -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: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Callable, Iterator
|
||||
from logging import Logger
|
||||
from typing import IO, Any
|
||||
from typing import IO
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from paramiko.channel import Channel
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -195,7 +195,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 = ...): ...
|
||||
|
||||
@@ -3,7 +3,7 @@ from collections.abc import Callable, Sequence
|
||||
from contextlib import AbstractContextManager
|
||||
from stat import S_IMODE as S_IMODE
|
||||
from types import TracebackType
|
||||
from typing import IO, Any
|
||||
from typing import IO
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
import paramiko
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -71,7 +71,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: ...
|
||||
|
||||
@@ -9,4 +9,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: ...
|
||||
|
||||
Reference in New Issue
Block a user