mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 13:02:22 +08:00
Use PEP 604 syntax wherever possible (#7493)
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
Reference in New Issue
Block a user