Use lowercase type everywhere (#6853)

This commit is contained in:
Alex Waygood
2022-01-08 15:09:29 +00:00
committed by GitHub
parent f8501d33c7
commit a40d79a4e6
172 changed files with 728 additions and 761 deletions

View File

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

View File

@@ -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 = ...,

View File

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

View File

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