* 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"
timegm takes struct_time objects, which are NamedTuples that have 9 elements by default
That would not take Tuple[Int], so typeshed would report errors
This reverts commit d43adbe97e.
Here's a simple example of code that breaks with this PR:
from typing import Mapping, Dict, Tuple
a = {('0', '0'): 42} # type: Mapping[Tuple[str, str], int]
b = a.get(('1', '1'), 0)
This gives an error on the last line:
error: No overload variant of "get" of "dict" matches argument types [Tuple[builtins.str, builtins.str], builtins.int]
* Add empty stubs for gettext Translations subclasses
GNUTranslations and NullTranslations do not add any methods to the base
Translations class, so remove the TODO comment and just declare the
classes.
* Add missing types for py3 gettext.
* Almost all re functions take a compiled pattern. (Even re.compile()!)
Fixes#188
Note: I'm using AnyStr so that the type of string used for pattern and
for the rest of the arguments must match. This is not 100% correct,
since Python 2 sometimes allows mixed types. But sometimes it
doesn't, depending on the values (e.g. non-ASCII bytes), and Python 3
always insists on matching, so I think this is actually a good idea.
* Same treatment for stdlib/3/re.pyi.
* subprocess.CalledProcessError output argument is optional.
* subprocess.CalledProcessError takes stderr argument in python3.
* subprocess: Fix type for command in call() and friends.
The stubs didn't correctly support the fact that you can pass a string
as well as a sequence of strings.
timezone inherits from tzinfo, so using tzinfo is more general (and e.g.
pytz types inherit directly from tzinfo).
This is the correct type, as quoted from astimezone's code:
elif not isinstance(tz, tzinfo):
raise TypeError("tz argument must be an instance of tzinfo")