From 4ca3517e224fbd69f0eae72134ec983663162bf9 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 11 May 2019 20:12:57 +0200 Subject: [PATCH] Fix some type hints --- telethon/client/downloads.py | 4 ++-- telethon/hints.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/telethon/client/downloads.py b/telethon/client/downloads.py index 16fdefad..9a11046b 100644 --- a/telethon/client/downloads.py +++ b/telethon/client/downloads.py @@ -139,7 +139,7 @@ class DownloadMethods(UserMethods): file: 'hints.FileLike' = None, *, thumb: 'hints.FileLike' = None, - progress_callback: 'hints.ProgressCallback' = None) -> typing.Optional[str]: + progress_callback: 'hints.ProgressCallback' = None) -> typing.Optional[typing.Union[str, bytes]]: """ Downloads the given media from a message object. @@ -232,7 +232,7 @@ class DownloadMethods(UserMethods): part_size_kb: float = None, file_size: int = None, progress_callback: 'hints.ProgressCallback' = None, - dc_id: int = None) -> None: + dc_id: int = None) -> typing.Optional[typing.Union[str, bytes]]: """ Low-level method to download files from their input location. diff --git a/telethon/hints.py b/telethon/hints.py index bd69f053..648e36d5 100644 --- a/telethon/hints.py +++ b/telethon/hints.py @@ -45,7 +45,8 @@ FileLike = typing.Union[ bytes, io.IOBase, types.TypeMessageMedia, - types.TypeInputFile + types.TypeInputFile, + types.TypeInputFileLocation ] OutFileLike = typing.Union[