mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-23 23:13:00 +03: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"
|
||||
|
||||
def __init__(
|
||||
self, *types: Union[Literal["photo"], Literal["audio"], Literal["video"]]
|
||||
self, *types: Literal["photo", "audio", "video"]
|
||||
) -> None:
|
||||
self._types = types or None
|
||||
|
||||
@property
|
||||
def types(
|
||||
self,
|
||||
) -> Tuple[Union[Literal["photo"], Literal["audio"], Literal["video"]], ...]:
|
||||
) -> Tuple[Literal["photo", "audio", "video"], ...]:
|
||||
"""
|
||||
The media types being checked.
|
||||
"""
|
||||
|
|
|
@ -77,7 +77,7 @@ NO_UPDATES_TIMEOUT = 15 * 60
|
|||
|
||||
ENTRY_ACCOUNT: Literal["ACCOUNT"] = "ACCOUNT"
|
||||
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.
|
||||
# We don't define a name for this as libraries shouldn't do that though.
|
||||
|
|
Loading…
Reference in New Issue
Block a user