[Django] #35372: Obsolete code in django\core\mail\__init__.py ?

9 views
Skip to first unread message

Django

unread,
Apr 13, 2024, 3:21:56 PM4/13/24
to django-...@googlegroups.com
#35372: Obsolete code in django\core\mail\__init__.py ?
------------------------------------------------+------------------------
Reporter: Danic | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Mail) | Version: 5.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
I found the following comment in django\core\mail\__init__.py

# Imported for backwards compatibility and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the introduction of email
# backends and the subsequent reorganization (See #10355)

#10355 relates to Django 1. As it's out of support, it maybe doesn't make
sense to keep the backwards compatibility. Would it make sense to have a
look at that file and check what of the code can be removed or if the
commend should be updated?
--
Ticket URL: <https://code.djangoproject.com/ticket/35372>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 14, 2024, 4:50:46 AM4/14/24
to django-...@googlegroups.com
#35372: Obsolete code in django\core\mail\__init__.py ?
-------------------------------------+-------------------------------------
Reporter: Danic | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Mail) | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by David Sanders):

I don't think we should remove these imports for a couple of reasons:

1. Some of them are documented as being imported from `django.core.mail`,
eg `SafeMIMEText` here: https://docs.djangoproject.com/en/5.0/topics/email
/#emailmessage-objects
2. There's no real harm in having some default imports? 🤔

If anything maybe we could remove the comment? 🤔
--
Ticket URL: <https://code.djangoproject.com/ticket/35372#comment:1>
Reply all
Reply to author
Forward
0 new messages