Use PEP 604 syntax wherever possible (#7493)

This commit is contained in:
Alex Waygood authored and GitHub committed 2022-03-16 16:01:33 +01:00
1 parent 15e21a8dc1
commit 3ab250eec8
174 files changed
+472 -490

No files matched your search

+4 -4
View File
@@ -1,7 +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, TypeVar, Union, overload
from typing import Any, Callable, ClassVar, Generic, Iterable, Iterator, Mapping, Pattern, Sequence, TypeVar, overload
from typing_extensions import Literal
from .commands import CoreCommands, RedisModuleCommands, SentinelCommands
@@ -9,11 +9,11 @@ from .connection import ConnectionPool, _ConnectionPoolOptions
from .lock import Lock
from .retry import Retry
_Value = Union[bytes, float, int, str]
_Key = Union[str, bytes]
_Value = bytes | float | int | str
_Key = str | bytes
# Lib returns str or bytes depending on value of decode_responses
_StrType = TypeVar("_StrType", bound=Union[str, bytes])
_StrType = TypeVar("_StrType", bound=str | bytes)
_VT = TypeVar("_VT")
_T = TypeVar("_T")
+2 -2
View File
@@ -1,13 +1,13 @@
import builtins
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from datetime import datetime, timedelta
from typing import Any, Generic, TypeVar, Union, overload
from typing import Any, Generic, TypeVar, overload
from typing_extensions import Literal
from ..client import _CommandOptions, _Key, _Value
_ScoreCastFuncReturn = TypeVar("_ScoreCastFuncReturn")
_StrType = TypeVar("_StrType", bound=Union[str, bytes])
_StrType = TypeVar("_StrType", bound=str | bytes)
class ACLCommands(Generic[_StrType]):
def acl_cat(self, category: str | None = ..., **kwargs: _CommandOptions) -> list[str]: ...