* Pyright detects and reports cases where a multi-part module name is accessed but is not explicitly imported. These are dangerous because they rely on import resolution ordering within a program, which can easily change. This change eliminates errors detected by pyright.
* Fixed regression caught by CI test.
* Fixed black formatting issues.
Co-authored-by: Eric Traut <erictr@microsoft.com>
Fixes#4288.
- Default imports to THIRD_PARTY, so in effect we merge the FIRST_PARTY and THIRD_PARTY stubs. This means import order is no longer affected by whether typing_extensions is installed locally.
- Treat typing_extensions, _typeshed and some others as standard library modules.
Note that isort master is very different from the latest release; we'll have to do something
different if and when the next isort release comes out.
The `update` method calls `self[key] = message` for each `(key, message)`
pair so it also accepts all the same message types as the `__setitem__`
method. Fix the signature so that the inputs are not restricted to
`Message` instances or to instance of the `_MessageType` type parameter,
but to the more reluctant `_MessageData` type alias.
* mailbox: Make stub-only helpers private
These HasIteritems and HasItems protocols don't exist in the real
mailbox module so prefix them with underscore to indicate they are
private.
* mailbox: Fix type of message argument
The Mailbox.add and Mailbox.__setitem__ methods take a message argument
which can be anything that is convertible to a Message. Fix the
signatures accordingly.