mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
* Change (Py3) email message payload type The docstring of the Message get_payload method indicates that the possible return types include None and bytes. Additionally the set_payload method accepts bytes. Therefore I've changed the PayloadType to include bytes and the get_payload return type to be an Optional PayloadType. * Change email (Py3) message_from_file IO types Instead of using TextIO and BinaryIO use IO[str] and IO[bytes] respectively to match the type returned by the open builtin. This follows the recommendations in #283. The error that prompts this is reproduced via: ``` from email import message_from_file with open('email') as file_: email = message_from_file(file_) ``` Argument 1 to "message_from_file" has incompatible type IO[Any]; expected "TextIO"