Commit Graph

8 Commits

Author SHA1 Message Date
Eric Traut
65450d81ff Fix multi-part module import errors (#4395)
* 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>
2020-08-06 09:03:54 +02:00
Jelle Zijlstra
0142a87da8 adjust isort config (#4290)
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.
2020-06-29 00:00:21 -07:00
Jelle Zijlstra
5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Jelle Zijlstra
43e93f803f use _typeshed's Path aliases (#4214) 2020-06-10 20:57:09 -07:00
Ian Good
160b093eb3 MaildirMessage.set_date accepts a float argument (#3617) 2020-01-16 19:06:13 +01:00
Tuomas Suutari
56688240a1 mailbox: Fix signature of Mailbox.update method (#3493)
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.
2019-11-25 19:45:53 -08:00
Tuomas Suutari
90004af132 mailbox: Couple small fixes (#3490)
* 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.
2019-11-24 17:54:58 -08:00
Rune Tynan
cd45623ab7 Mailbox stubs (#3427) 2019-11-22 21:03:31 -08:00