mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-17 18:46:40 +00:00
Simplify Union of Literal types (#4246)
This commit is contained in:
parent
4f4db020da
commit
35fd0cc62b
@ -159,14 +159,14 @@ class Media(Combinable):
|
|||||||
__slots__ = "_types"
|
__slots__ = "_types"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, *types: Union[Literal["photo"], Literal["audio"], Literal["video"]]
|
self, *types: Literal["photo", "audio", "video"]
|
||||||
) -> None:
|
) -> None:
|
||||||
self._types = types or None
|
self._types = types or None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def types(
|
def types(
|
||||||
self,
|
self,
|
||||||
) -> Tuple[Union[Literal["photo"], Literal["audio"], Literal["video"]], ...]:
|
) -> Tuple[Literal["photo", "audio", "video"], ...]:
|
||||||
"""
|
"""
|
||||||
The media types being checked.
|
The media types being checked.
|
||||||
"""
|
"""
|
||||||
|
@ -77,7 +77,7 @@ NO_UPDATES_TIMEOUT = 15 * 60
|
|||||||
|
|
||||||
ENTRY_ACCOUNT: Literal["ACCOUNT"] = "ACCOUNT"
|
ENTRY_ACCOUNT: Literal["ACCOUNT"] = "ACCOUNT"
|
||||||
ENTRY_SECRET: Literal["SECRET"] = "SECRET"
|
ENTRY_SECRET: Literal["SECRET"] = "SECRET"
|
||||||
Entry = Union[Literal["ACCOUNT"], Literal["SECRET"], int]
|
Entry = Union[Literal["ACCOUNT", "SECRET"], int]
|
||||||
|
|
||||||
# Python's logging doesn't define a TRACE level. Pick halfway between DEBUG and NOTSET.
|
# Python's logging doesn't define a TRACE level. Pick halfway between DEBUG and NOTSET.
|
||||||
# We don't define a name for this as libraries shouldn't do that though.
|
# We don't define a name for this as libraries shouldn't do that though.
|
||||||
|
Loading…
Reference in New Issue
Block a user