Skip to content

Commit

Permalink
[add] Adding type hints/annotations for text_to_speech
Browse files Browse the repository at this point in the history
  • Loading branch information
Animenosekai committed Apr 25, 2021
1 parent f4b03e0 commit 603cdce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion translatepy/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def dictionary(self, text, destination_language, source_language=None) -> Union[
DICTIONARY_CACHES[str({"t": str(text), "d": str(destination_language), "s": str(lang)})] = response
return response

def text_to_speech(self, text, source_language=None):
def text_to_speech(self, text, source_language=None) -> Union[bytes, None]:
"""
Gives back the text to speech result for the given text
Expand Down
2 changes: 1 addition & 1 deletion translatepy/translators/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def define(self):
"""Returns the definition of the given word"""
raise NotImplementedError

def text_to_speech(self, text, source_language=None):
def text_to_speech(self, text, source_language=None) -> Union[bytes, None]:
"""
Gives back the text to speech result for the given text
Expand Down

0 comments on commit 603cdce

Please sign in to comment.