mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-22 01:28:29 +08:00
Use lowercase type everywhere (#6853)
This commit is contained in:
@@ -1,21 +1,7 @@
|
||||
import threading
|
||||
from _typeshed import Self, SupportsItems
|
||||
from datetime import datetime, timedelta
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
ClassVar,
|
||||
Generic,
|
||||
Iterable,
|
||||
Iterator,
|
||||
Mapping,
|
||||
Pattern,
|
||||
Sequence,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing import Any, Callable, ClassVar, Generic, Iterable, Iterator, Mapping, Pattern, Sequence, TypeVar, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .commands import CoreCommands, RedisModuleCommands, SentinelCommands
|
||||
@@ -273,7 +259,7 @@ class Redis(RedisModuleCommands, CoreCommands[_StrType], SentinelCommands, Gener
|
||||
timeout: float | None,
|
||||
sleep: float,
|
||||
blocking_timeout: float | None,
|
||||
lock_class: Type[_LockType],
|
||||
lock_class: type[_LockType],
|
||||
thread_local: bool = ...,
|
||||
) -> _LockType: ...
|
||||
@overload
|
||||
@@ -284,7 +270,7 @@ class Redis(RedisModuleCommands, CoreCommands[_StrType], SentinelCommands, Gener
|
||||
sleep: float = ...,
|
||||
blocking_timeout: float | None = ...,
|
||||
*,
|
||||
lock_class: Type[_LockType],
|
||||
lock_class: type[_LockType],
|
||||
thread_local: bool = ...,
|
||||
) -> _LockType: ...
|
||||
def pubsub(self, *, shard_hint: Any = ..., ignore_subscribe_messages: bool = ...) -> PubSub: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Mapping, Type
|
||||
from typing import Any, Mapping
|
||||
|
||||
from .retry import Retry
|
||||
|
||||
@@ -87,7 +87,7 @@ class Connection:
|
||||
encoding: str = ...,
|
||||
encoding_errors: str = ...,
|
||||
decode_responses: bool = ...,
|
||||
parser_class: Type[BaseParser] = ...,
|
||||
parser_class: type[BaseParser] = ...,
|
||||
socket_read_size: int = ...,
|
||||
health_check_interval: int = ...,
|
||||
client_name: str | None = ...,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from types import TracebackType
|
||||
from typing import Any, ClassVar, Protocol, Type
|
||||
from typing import Any, ClassVar, Protocol
|
||||
|
||||
from redis.client import Redis
|
||||
|
||||
@@ -27,7 +27,7 @@ class Lock:
|
||||
def register_scripts(self) -> None: ...
|
||||
def __enter__(self) -> Lock: ...
|
||||
def __exit__(
|
||||
self, exc_type: Type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
def acquire(
|
||||
self, blocking: bool | None = ..., blocking_timeout: None | int | float = ..., token: str | bytes | None = ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Type, TypeVar, overload
|
||||
from typing import Any, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
from redis.client import Redis
|
||||
@@ -47,9 +47,9 @@ class Sentinel(SentinelCommands):
|
||||
@overload
|
||||
def master_for(self, service_name: str, *, connection_pool_class=..., **kwargs) -> Redis[Any]: ...
|
||||
@overload
|
||||
def master_for(self, service_name: str, redis_class: Type[_Redis] = ..., connection_pool_class=..., **kwargs) -> _Redis: ...
|
||||
def master_for(self, service_name: str, redis_class: type[_Redis] = ..., connection_pool_class=..., **kwargs) -> _Redis: ...
|
||||
@overload
|
||||
def slave_for(self, service_name: str, connection_pool_class=..., **kwargs) -> Redis[Any]: ...
|
||||
@overload
|
||||
def slave_for(self, service_name: str, redis_class: Type[_Redis] = ..., connection_pool_class=..., **kwargs) -> _Redis: ...
|
||||
def slave_for(self, service_name: str, redis_class: type[_Redis] = ..., connection_pool_class=..., **kwargs) -> _Redis: ...
|
||||
def execute_command(self, *args, **kwargs) -> Literal[True]: ...
|
||||
|
||||
Reference in New Issue
Block a user