[Django] #28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV & MONTHS_3/MONTHS_3_REV

4 views
Skip to first unread message

Django

unread,
Nov 15, 2017, 7:20:31 AM11/15/17
to django-...@googlegroups.com
#28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV &
MONTHS_3/MONTHS_3_REV
-----------------------------------------+------------------------
Reporter: Chris Lamb | Owner: nobody
Type: Uncategorized | Status: new
Component: Utilities | Version: 2.0
Severity: Normal | Keywords: dates
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
We have no `MONTHS_REV` despite having `MONTHS` whilst we have `WEEKDAYS`
and its reverse `WEEKDAYS_REV`, as well as `MONTHS_3` and `MONTHS_3_REV`.

--
Ticket URL: <https://code.djangoproject.com/ticket/28798>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 15, 2017, 7:21:56 AM11/15/17
to django-...@googlegroups.com
#28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV &
MONTHS_3/MONTHS_3_REV
-------------------------------+--------------------------------------

Reporter: Chris Lamb | Owner: nobody
Type: Uncategorized | Status: new
Component: Utilities | Version: 2.0
Severity: Normal | Resolution:

Keywords: dates | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Chris Lamb):

* has_patch: 0 => 1
* needs_tests: 0 => 1


Comment:

PR: https://github.com/django/django/pull/9355

--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:1>

Django

unread,
Nov 15, 2017, 9:16:53 AM11/15/17
to django-...@googlegroups.com
#28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV &
MONTHS_3/MONTHS_3_REV
-------------------------------------+-------------------------------------

Reporter: Chris Lamb | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Utilities | Version: 2.0
Severity: Normal | Resolution:

Keywords: dates | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* type: Uncategorized => Cleanup/optimization


Comment:

`MONTHS_3_REV` and `WEEKDAYS_REV` have been in Django since the first
commit ("Imported Django from private SVN repository"), but they've never
been used. I'd be more inclined to remove them than to add another unused
dictionary. Have you found many projects using these dicts?

--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:2>

Django

unread,
Nov 16, 2017, 3:24:49 AM11/16/17
to django-...@googlegroups.com
#28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV &
MONTHS_3/MONTHS_3_REV
-------------------------------------+-------------------------------------

Reporter: Chris Lamb | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Utilities | Version: 2.0
Severity: Normal | Resolution:

Keywords: dates | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Chris Lamb):

Replying to [comment:2 Tim Graham]:


> Have you found many projects using these dicts?

I find myself reaching for them fairly often, particulary when making a
custom-ish date dropdown or some (admittedly trivial) parsing.

--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:3>

Django

unread,
Nov 16, 2017, 10:17:33 AM11/16/17
to django-...@googlegroups.com
#28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV &
MONTHS_3/MONTHS_3_REV
-------------------------------------+-------------------------------------

Reporter: Chris Lamb | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Utilities | Version: 2.0
Severity: Normal | Resolution:

Keywords: dates | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

I also wonder if these dictionaries merit a continued presence because
they are English-centric. I didn't find any usage of them in a GitHub code
search.

--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:4>

Django

unread,
Nov 16, 2017, 1:06:09 PM11/16/17
to django-...@googlegroups.com
#28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV &
MONTHS_3/MONTHS_3_REV
-------------------------------------+-------------------------------------

Reporter: Chris Lamb | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Utilities | Version: 2.0
Severity: Normal | Resolution:

Keywords: dates | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Chris Lamb):

Replying to [comment:4 Tim Graham]:


> I also wonder if these dictionaries merit a continued presence because
they are English-centric. I didn't find any usage of them in a GitHub code
search.

That's a fair comment. Shall we just remove the entire file? I'd prefer it
"complete" or gone, really :)

--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:5>

Django

unread,
Nov 16, 2017, 1:21:50 PM11/16/17
to django-...@googlegroups.com
#28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV &
MONTHS_3/MONTHS_3_REV
-------------------------------------+-------------------------------------

Reporter: Chris Lamb | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Utilities | Version: 2.0
Severity: Normal | Resolution:

Keywords: dates | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

Only the `_REV` suffixed dictionaries are unused. My thinking is to remove
them. `django/utils/dateformat.py` uses the other variables.

--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:6>

Django

unread,
Nov 16, 2017, 1:23:00 PM11/16/17
to django-...@googlegroups.com
#28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV &
MONTHS_3/MONTHS_3_REV
-------------------------------------+-------------------------------------

Reporter: Chris Lamb | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Utilities | Version: 2.0
Severity: Normal | Resolution:

Keywords: dates | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Chris Lamb):

Replying to [comment:6 Tim Graham]:


> Only the `_REV` suffixed dictionaries are unused. My thinking is to
remove them. `django/utils/dateformat.py` uses the other variables.

Ahhh, my bad. Well, in that case I'd err in terms of completing it (ie.
applying this patch).

--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:7>

Django

unread,
Nov 16, 2017, 5:50:30 PM11/16/17
to django-...@googlegroups.com
#28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV &
MONTHS_3/MONTHS_3_REV
-------------------------------------+-------------------------------------

Reporter: Chris Lamb | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Utilities | Version: 2.0
Severity: Normal | Resolution:

Keywords: dates | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

Usually we've removed things in `django.utils` once Django no longer uses
it. Offhand, I can't think of something in there that Django doesn't use.

--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:8>

Django

unread,
Nov 16, 2017, 6:44:00 PM11/16/17
to django-...@googlegroups.com
#28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV &
MONTHS_3/MONTHS_3_REV
-------------------------------------+-------------------------------------

Reporter: Chris Lamb | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Utilities | Version: 2.0
Severity: Normal | Resolution:

Keywords: dates | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Chris Lamb):

Cool, so in summary, we have three paths forward:

a) Remove the unused ``_REV``
b) Complete the set.
c) No action.

You seem to be in favour of "a", I'm leaning towards "b". I'm easy with
either - let me know which you would like and I'll go ahead and update the
PR/whatever. :)

--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:9>

Django

unread,
Nov 17, 2017, 3:59:02 AM11/17/17
to django-...@googlegroups.com
#28798: Add a MONTHS_REV dict to match WEEKDAYS/WEEKDAYS_REV &
MONTHS_3/MONTHS_3_REV
-------------------------------------+-------------------------------------

Reporter: Chris Lamb | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Utilities | Version: 2.0
Severity: Normal | Resolution:

Keywords: dates | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

I'd favour "a", too, unless we find a general-enough use case to
demonstrate their utility.

--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:10>

Django

unread,
Nov 17, 2017, 11:22:16 AM11/17/17
to django-...@googlegroups.com
#28798: Remove unused django.utils.dates.WEEKDAYS_REV, MONTHS_3_REV
-------------------------------------+-------------------------------------

Reporter: Chris Lamb | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Utilities | Version: 2.0
Severity: Normal | Resolution:
Keywords: dates | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Ready for checkin
* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:11>

Django

unread,
Nov 17, 2017, 3:38:24 PM11/17/17
to django-...@googlegroups.com
#28798: Remove unused django.utils.dates.WEEKDAYS_REV, MONTHS_3_REV
-------------------------------------+-------------------------------------
Reporter: Chris Lamb | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Utilities | Version: 2.0
Severity: Normal | Resolution: fixed

Keywords: dates | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"648957b707491b99dc32a3cdbeaaa3fe9f3164cf" 648957b]:
{{{
#!CommitTicketReference repository=""
revision="648957b707491b99dc32a3cdbeaaa3fe9f3164cf"
Fixed #28798 -- Removed unused django.utils.dates.WEEKDAYS_REV,
MONTHS_3_REV.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28798#comment:12>

Reply all
Reply to author
Forward
0 new messages