From 0246f9fcf3b891c641d291384160e8000c0daa24 Mon Sep 17 00:00:00 2001 From: Jordan Hayashi Date: Tue, 19 Jul 2022 14:12:30 -0400 Subject: [PATCH] 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 --- django-stubs/core/mail/__init__.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/core/mail/__init__.pyi b/django-stubs/core/mail/__init__.pyi index e479b40..c3e45ba 100644 --- a/django-stubs/core/mail/__init__.pyi +++ b/django-stubs/core/mail/__init__.pyi @@ -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] = ...,