Update Unused parameters in stubs/ (#9704)

* Update _Unused TypeAlias

* Update `object | None` params

* Replace unused `object` parameters with `Unused` alias
This commit is contained in:
Avasam
2023-02-22 02:52:52 -05:00
committed by GitHub
parent fbc092b4cd
commit 078c6a0958
33 changed files with 134 additions and 133 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
from _typeshed import Incomplete
from _typeshed import Incomplete, Unused
from collections.abc import Callable, Iterable, Sequence
from threading import Lock
from types import TracebackType
@@ -15,8 +15,8 @@ from redis.typing import EncodableT
def get_node_name(host: str, port: str | int) -> str: ...
def get_connection(redis_node: Redis[Any], *args, **options: _ConnectionPoolOptions) -> Connection: ...
def parse_scan_result(command: object, res, **options): ...
def parse_pubsub_numsub(command: object, res, **options: object): ...
def parse_scan_result(command: Unused, res, **options): ...
def parse_pubsub_numsub(command: Unused, res, **options: Unused): ...
def parse_cluster_slots(resp, **options) -> dict[tuple[int, int], dict[str, Any]]: ...
PRIMARY: str
+3 -3
View File
@@ -1,4 +1,4 @@
from _typeshed import Incomplete
from _typeshed import Incomplete, Unused
from collections.abc import Callable, Iterable, Mapping
from queue import Queue
from socket import socket
@@ -132,7 +132,7 @@ class Connection:
def set_parser(self, parser_class: type[BaseParser]) -> None: ...
def connect(self) -> None: ...
def on_connect(self) -> None: ...
def disconnect(self, *args: object) -> None: ... # 'args' added in redis 4.1.2
def disconnect(self, *args: Unused) -> None: ... # 'args' added in redis 4.1.2
def check_health(self) -> None: ...
def send_packed_command(self, command: str | Iterable[str], check_health: bool = ...) -> None: ...
def send_command(self, *args, **kwargs) -> None: ...
@@ -207,7 +207,7 @@ class ConnectionPool:
self, connection_class: type[Connection] = ..., max_connections: int | None = ..., **connection_kwargs
) -> None: ...
def reset(self) -> None: ...
def get_connection(self, command_name: object, *keys, **options: _ConnectionPoolOptions) -> Connection: ...
def get_connection(self, command_name: Unused, *keys, **options: _ConnectionPoolOptions) -> Connection: ...
def make_connection(self) -> Connection: ...
def release(self, connection: Connection) -> None: ...
def disconnect(self, inuse_connections: bool = ...) -> None: ...
+2 -1
View File
@@ -1,3 +1,4 @@
from _typeshed import Unused
from collections.abc import Iterable, Mapping
from contextlib import AbstractContextManager
from typing import Any, TypeVar, overload
@@ -19,4 +20,4 @@ def str_if_bytes(value: str | bytes) -> str: ...
def safe_str(value: object) -> str: ...
def dict_merge(*dicts: Mapping[str, _T]) -> dict[str, _T]: ...
def list_keys_to_dict(key_list, callback): ... # unused, alias for `dict.fromkeys`
def merge_result(command: object, res: Mapping[Any, Iterable[_T]]) -> list[_T]: ...
def merge_result(command: Unused, res: Mapping[Any, Iterable[_T]]) -> list[_T]: ...