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.
Currently,
translate_documenthas the following type annotation forinput_documentHowever,
translate_documentessentially just callstranslate_document_uploud, which has:I do not really see a reason why you would have less types in
translate_documentthantranslate_document_uploud, especially since intranslate_document's docstring you have: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
Anyis to either read the docstring or drill down the code. Unsure if that was the intention, if it was, I apologize.