Signature of bytearray.__delitem__ is overloaded to support both
int and slice as parameters. Use a union instead.
This is needed to change bytearray's superclass from Sequence[int]
to MutableSequence[int], because the current signature of
__delitem__ is incompatible with that of MutableSequence.
As of Python 2.7, you can pass in multiple iterables into some set
methods like union, intersection, difference, and update. So, for
example, `new_set = a.union(b, c)`.
- Move Loader and ModuleType into _importlib_modulespec.pyi.
- Add "import X as X" for these to types.pyi and importlib/abc.pyi.
The goal is to ensure mypy -i still works, to fix https://github.com/python/mypy/issues/1797.
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].
* urllib.parse: Make return type of unquote_from_bytes str.
* urllib.parse: Reject encoding when quote is passed bytes.
encoding and errors must not be supplied to quote_plus and
quote if the first parameter is a bytes, or a TypeError is raised.
So overload quote and do not put encoding and errors in the
version where bytes is the first parameter.
quote and quote_plus also allow string and safe to be of different
types. Also allow that in the stubs.
* Fix some misspelled method names that were also missing 'self'
* Initial stubs for importlib.machinery
* Use importlib.machinery.ModuleSpec everywhere
* 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"