mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-09-21 03:08:49 +03:00
Fix Python 3.5.2 type hinting (#1177)
This commit is contained in:
parent
7249d01709
commit
8c771a842f
|
@ -33,9 +33,6 @@ TotalList = helpers.TotalList
|
||||||
|
|
||||||
DateLike = typing.Optional[typing.Union[float, datetime.datetime, datetime.date, datetime.timedelta]]
|
DateLike = typing.Optional[typing.Union[float, datetime.datetime, datetime.date, datetime.timedelta]]
|
||||||
|
|
||||||
|
|
||||||
# Note: we can't use `io.BytesIO` directly due to a bug in
|
|
||||||
# Python 3.5.2's `typing`: https://github.com/python/typing/issues/266
|
|
||||||
LocalPath = str
|
LocalPath = str
|
||||||
ExternalUrl = str
|
ExternalUrl = str
|
||||||
BotFileID = str
|
BotFileID = str
|
||||||
|
@ -50,11 +47,19 @@ FileLike = typing.Union[
|
||||||
types.TypeInputFileLocation
|
types.TypeInputFileLocation
|
||||||
]
|
]
|
||||||
|
|
||||||
OutFileLike = typing.Union[
|
# Can't use `typing.Type` in Python 3.5.2
|
||||||
str,
|
# See https://github.com/python/typing/issues/266
|
||||||
typing.Type[bytes],
|
try:
|
||||||
typing.BinaryIO
|
OutFileLike = typing.Union[
|
||||||
]
|
str,
|
||||||
|
typing.Type[bytes],
|
||||||
|
typing.BinaryIO
|
||||||
|
]
|
||||||
|
except TypeError:
|
||||||
|
OutFileLike = typing.Union[
|
||||||
|
str,
|
||||||
|
typing.BinaryIO
|
||||||
|
]
|
||||||
|
|
||||||
MessageLike = typing.Union[str, types.Message]
|
MessageLike = typing.Union[str, types.Message]
|
||||||
MessageIDLike = typing.Union[int, types.Message, types.TypeInputMessage]
|
MessageIDLike = typing.Union[int, types.Message, types.TypeInputMessage]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user