Commit Graph

12 Commits

Author SHA1 Message Date
Lukasz Langa
b84f20a011 Fixing flake8 W errors 2016-12-19 21:52:56 -08:00
peterdotran
ce940efc01 email.utils.parsedate and email.utils.parsedate_tz corrected to be passable to time.mktime (#497)
Also email.utils.parsedate_tz 10th element can be None if no timezone is specified
2016-08-24 06:10:56 -07:00
Valérian Rousset
24086b2195 Finish mail (#396)
* remove old email files

* finish email.mime

* finish email.encoders

* email.utils: stubgen run, reorder

* finish email.utils

* finish email.iterators

* email.mime is a module

* fix mime
2016-07-29 15:25:52 -07:00
Guido van Rossum
39325bf159 Mypy now supports sys.platform and sys.version_info checks (#410) 2016-07-27 13:25:29 -07:00
Eklavya Sharma
df1a655858 email.header: Make decode_header also accept str. (#333)
decode_header accepts a parameter of type str or Header, but the
stub for decode_header types the parameter as Header.  Change
that to Union[Header, str].
2016-07-04 18:11:49 -07:00
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
Valérian Rousset
5b5f01f33c Improve email.* (#207)
* improve email

* complete email.message

* complete email.policy

* complete email.parser

* complete email.generator

* complete email.headerregistry

* complete email.contentmanager

* complete email.header

* complete email.charset

* complete email.errors

* complete email.feedparser
2016-05-30 10:04:51 -07:00
Tim Abbott
b30ca8e42b Add python 2 email.message_from_* stubs (and add types for py3). 2016-01-27 15:46:00 -08:00
Matthias Kramm
94c9ce8fd0 Consistently use '= ...' for optional parameters. 2015-11-09 13:55:02 -08:00
Matthias Kramm
375bf063b1 Fix parse errors 2015-11-09 13:37:08 -08:00
Matthias Kramm
4fe8915d44 Add missing '-> None' to all __init__ methods. 2015-11-09 10:25:11 -08:00
Matthias Kramm
337abed05a add (overwrite with) mypy stubs, if available 2015-09-30 09:59:44 -07:00