-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Description
Currently, translate_document
has the following type annotation for input_document
input_document: Union[TextIO, BinaryIO, Any],
However, translate_document
essentially just calls translate_document_uploud
, which has:
input_document: Union[TextIO, BinaryIO, str, bytes, Any]
I do not really see a reason why you would have less types in translate_document
than translate_document_uploud
, especially since in translate_document
's docstring you have:
:param filename: (Optional) Filename including extension, only required
if uploading string or bytes containing file content.
So you allow the user to provide bytes or str as input but the only way to verify if bytes and str are valid under Any
is to either read the docstring or drill down the code. Unsure if that was the intention, if it was, I apologize.
JanEbbing
Metadata
Metadata
Assignees
Labels
No labels