Third-party stubs: audit more Callable[<parameters>, Any] annotations (#8233)

This commit is contained in:
Alex Waygood
2022-07-04 09:29:47 +01:00
committed by GitHub
parent fb478f0b58
commit 8ef6602e25
12 changed files with 17 additions and 18 deletions

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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