Use a more general type for django.core.mail.send_mass_mail's datatuple (#1062)

* Use a datatuple in django.core.mail.send_mass_mail

Even though the implementation works for both a List of tuples and a
tuple of tuples, the docs recommend using a tuple.

https://github.com/django/django/blob/main/django/core/mail/__init__.py#L112
https://docs.djangoproject.com/en/4.0/topics/email/#send-mass-mail

* Use a more general type for send_mass_mail's datatuple
This commit is contained in:
Jordan Hayashi
2022-07-19 14:12:30 -04:00
committed by GitHub
parent e7a89f73c4
commit 0246f9fcf3

View File

@@ -1,4 +1,4 @@
from typing import Any, List, Optional, Sequence, Tuple
from typing import Any, Iterable, List, Optional, Sequence, Tuple
from .message import DEFAULT_ATTACHMENT_MIME_TYPE as DEFAULT_ATTACHMENT_MIME_TYPE
from .message import BadHeaderError as BadHeaderError
@@ -23,7 +23,7 @@ def send_mail(
html_message: Optional[str] = ...,
) -> int: ...
def send_mass_mail(
datatuple: List[Tuple[str, str, str, List[str]]],
datatuple: Iterable[Tuple[str, str, str, List[str]]],
fail_silently: bool = ...,
auth_user: Optional[str] = ...,
auth_password: Optional[str] = ...,