Files
typeshed/stdlib/3/email
Phil Jones f6decefd02 Fix email typing errors (#288)
* 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"
2016-06-11 10:43:08 -07:00
..
2016-06-11 10:43:08 -07:00
2016-05-30 10:04:51 -07:00
2016-05-30 10:04:51 -07:00
2016-05-30 10:04:51 -07:00
2016-05-30 10:04:51 -07:00
2016-05-30 10:04:51 -07:00
2016-05-30 10:04:51 -07:00
2016-05-30 10:04:51 -07:00
2016-06-11 10:43:08 -07:00
2016-05-30 10:04:51 -07:00
2016-05-30 10:04:51 -07:00