Commit Graph

64 Commits

Author SHA1 Message Date
Shantanu
1537a598d0 email.message: fix return type of get_charsets (#9944)
Fixes #9885
2023-03-26 00:42:45 +00:00
Alex Waygood
dd2818a41d Stdlib: add container default values (#9909) 2023-03-21 09:12:34 +01:00
Alex Waygood
257e287fec Stdlib: correct many parameter names (#9815) 2023-03-04 09:53:12 +00:00
Shantanu
58edfea33f email.parser: narrow io types (#9737) 2023-02-15 10:43:39 +01:00
Alex Waygood
9ed39d8796 Use typing_extensions.Self in the stdlib (#9694) 2023-02-09 09:12:13 +00:00
Alex Waygood
0ef9c3f8e8 Enable flake8-pyi's Y037 (#9686) 2023-02-06 19:01:02 -08:00
Alex Waygood
b5a26d1ca2 email.message: Fix invalid TypeVar usage; add some default values (#9620) 2023-01-30 17:56:29 +01:00
Alex Waygood
33a62ae42d Add more defaults to the stdlib (#9606)
Continuing work towards #8988.

The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are:

- Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine)
- Defaults in non-py311 branches
- Defaults for float parameters
- Defaults for overloads
2023-01-29 01:51:23 +00:00
Alex Waygood
d98d1674e7 Fix a few issues with parameter defaults (#9572) 2023-01-20 09:47:59 -08:00
Jelle Zijlstra
ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Martin Fischer
554989e31f stdlib: Fix types of semi-public Message methods (#9456) 2023-01-04 11:21:33 +01:00
Sebastian Rittau
a74df38df0 Message.get_content_charset() returns None by default (#9344) 2022-12-09 07:19:18 -08:00
Jelle Zijlstra
7ab933f3c3 email: improve bytes handling (#9032) 2022-11-01 10:13:30 +01:00
Nikita Sobolev
380022c650 Remove empty __init__ methods (#8816) 2022-09-30 13:08:41 +01:00
Nikita Sobolev
0259068ad6 Remove duplicate definitions in sub-classes (#8594) 2022-08-26 17:10:55 +02:00
Nikita Sobolev
5cc966cc57 Improve email.headerregistry.HeaderRegistry stub (#8516) 2022-08-10 19:00:11 +01:00
Alex Waygood
892796a794 Remove, move or # noqa more TypeAlias declarations (#8450) 2022-08-05 13:03:19 +01:00
Kevin Kirsche
5732b8f34e email.Message.walk yields self (#8398)
This updates the generator used by `Message` to return `Self` so that it correctly changes when a `MIMEPart` or `EmailMessage`.

Fixes #8290
2022-07-26 11:17:45 +02:00
Sebastian Rittau
5534007189 Fix return type of email.header.decode_header() (#8337) 2022-07-19 20:43:48 +01:00
Alex Waygood
6348a58b8b Import Match and Pattern from re, not typing (#8277) 2022-07-12 15:32:48 +02:00
Alex Waygood
edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Alex Waygood
8b3b6bf7cd stdlib: Audit Callable[<parameters>, None] annotations (#8187) 2022-06-27 08:08:28 +02:00
Alex Waygood
b093c90a94 Use TypeAlias for type aliases where possible, part II (#7667) 2022-04-20 20:02:47 +01:00
Alex Waygood
85594df83b Use re-exports instead of TypeAliases in email.parser (#7665) 2022-04-20 07:31:52 -07:00
Alex Waygood
97a74bc1aa Import from collections.abc wherever possible (#7635) 2022-04-18 12:50:37 +02:00
Alex Waygood
740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Alex Waygood
3c85f36b7f Reduce code duplication in the email module (#7558) 2022-04-06 12:20:14 +02:00
Alex Waygood
d086488e0e Revert "Use import instead of type alias in email/message.pyi" (#7548)
Let's see if this is fixed in mypy 0.942.

This reverts the changes made in #7022, which was a hack to fix #7019
2022-03-24 11:22:30 -07:00
Alex Waygood
1acc8f3bd6 Use PEP 604 syntax wherever possible, part II (#7514)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-03-19 14:27:35 +00:00
Alex Waygood
3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Martin Fischer
ec87fbfe88 stdlib: Add email.iterators._structure(msg) 2022-03-06 15:57:52 -08:00
Alex Waygood
a0b41959ec stdlib: fix many attributes which are read-only at runtime but read-write in the stub (#7395) 2022-02-27 16:23:09 -08:00
Alex Waygood
b74acc7546 Add all the email __all__s (#7304) 2022-02-19 17:53:29 -08:00
Alex Waygood
fbc279e3f5 stdlib: Add many missing dunder overrides (#7231) 2022-02-16 06:25:47 -08:00
Alex Waygood
f4967618dd Fix positional-only differences in many stdlib modules (#7226) 2022-02-15 15:14:06 +01:00
Alex Waygood
7ccbbdb30a stdlib: Improve many __iter__ and constructor methods (#7112) 2022-02-02 19:14:57 +01:00
Shantanu
b88a6f19cd Upgrade black version (#7089) 2022-01-30 16:27:06 -08:00
Jelle Zijlstra
3b29006a3e email.generator: Use protocols instead of TextIO/BinaryIO (#7082) 2022-01-30 14:02:11 +01:00
Alex Waygood
45a2dad83c Reduce use of Any in equality methods (#7081)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-01-30 00:59:00 +02:00
Alex Waygood
6346464aed Use import instead of type alias in email/message.pyi (#7022) 2022-01-24 13:00:29 +01:00
Alex Waygood
96c9abb058 Always use _typeshed.Self, where applicable (#6880)
* Always use `_typeshed.Self`, where applicable

* Revert changes to `google-cloud-ndb` (ambiguous)

* Remove empty line added by script

* Revert changes to `stubs/python-dateutil/dateutil/relativedelta.pyi`

* Manually add a few more that the script missed

* Improve `filelock` annotation

Source code here: 79ec7b2826/src/filelock/_api.py (L207)

* Improve `opentracing/scope` annotation

Source code here: 3e1d357a34/opentracing/scope.py (L71)

* Improve `redis/client` stub

Source code here: 15f315a496/redis/client.py (L1217)

* Improve `redis/lock` annotation

Source code here: 15f315a496/redis/lock.py (L155)

* Improve `requests/models` annotation

Source code here: d718e75383/requests/models.py (L653)
2022-01-09 19:16:19 -08:00
Alex Waygood
4e046163b5 Delete many redundant method redefinitions (#6877) 2022-01-09 11:21:03 -08:00
Alex Waygood
a40d79a4e6 Use lowercase type everywhere (#6853) 2022-01-08 16:09:29 +01:00
Sebastian Rittau
e77a66aced Update pyright (#6840) 2022-01-07 18:58:15 +02:00
Alex Waygood
a82a4bc62b email: add Message methods (#6731)
Add `email.message.Message` methods, mark `email.iterators.walk` as wontfix
2021-12-29 10:40:06 -06:00
Alex Waygood
8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Joseph Young
b842b21770 Add email.quoprimime stub (#6664)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-12-23 00:56:57 +02:00
Joseph Young
d6f062314f Add email.base64mime stub (#6659) 2021-12-23 00:25:00 +02:00
Alex Waygood
5dcca3fe46 Improve stubs for email.policy (#6631)
* Add the ABCMeta metaclass, present at runtime.
* Add missing attributes from the allowlist, which are documented.
* Annotate the __init__ methods according to the documentation.
2021-12-19 23:38:08 +01:00
Alex Waygood
3d9599cec1 Improve stubs for email.headerregistry (#6588)
* Add max_count class vars
* Add init() methods
* Fix ContentDispositionHeader.content_disposition return type
2021-12-16 12:42:07 +01:00