Opened 3 months ago
Last modified 7 weeks ago
#36104 assigned Cleanup/optimization
forms.Media shouldn't expect media objects only
Description ¶
While thinking about https://forum.djangoproject.com/t/rejuvenating-vs-deprecating-form-media/21285 I have noticed that the forms.Media.__add__
method assumes that media objects are only ever added to each other. That doesn't necessarily have to be the case.
I propose returning NotImplemented
when the RHS isn't a Media
instance but something else.
All tests pass locally.
(It has nothing to do with https://code.djangoproject.com/ticket/35648 specifically but the same discussion probably applies.)
According to the ticket's flags, the next step(s) to move this issue forward are:
- To improve the patch as described in the pull request review comments or on this ticket, then uncheck "Patch needs improvement".
If creating a new pull request, include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.
Change History (3)
comment:1 by , 3 months ago
comment:2 by , 3 months ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Bug → Cleanup/optimization |
Version: | 5.1 → dev |
Accepting, this is somewhat similar in concept to #35648.
comment:3 by , 7 weeks ago
Patch needs improvement: | set |
---|
PR