[Django] #23105: Cosmetic change on lru_cache backport

1 view
Skip to first unread message

Django

unread,
Jul 26, 2014, 9:48:27 AM7/26/14
to django-...@googlegroups.com
#23105: Cosmetic change on lru_cache backport
--------------------------------------+-----------------------
Reporter: areski | Owner: areski
Type: Cleanup/optimization | Status: new
Component: Utilities | Version: master
Severity: Normal | Keywords: lru_cache
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+-----------------------
A backport for lru_cache has been imported to Django:
https://github.com/django/django/blob/master/django/utils/lru_cache.py
Unfortunately when importing it, we added an non-necessary extra indent.

FYI, lru_cache last backport is now
https://bitbucket.org/jaraco/backports.functools_lru_cache/

To improve the code style, I moved the backport to a separate file, that
way the code will be cleaner and it will be easier to keep in sync with
the original code on bitbucket.

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

Django

unread,
Jul 26, 2014, 9:49:46 AM7/26/14
to django-...@googlegroups.com
#23105: Cosmetic change on lru_cache backport
-------------------------------------+-------------------------------------
Reporter: areski | Owner: areski
Type: | Status: new
Cleanup/optimization | Version: master
Component: Utilities | Resolution:
Severity: Normal | Triage Stage:
Keywords: lru_cache | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

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

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

Django

unread,
Jul 26, 2014, 9:55:07 AM7/26/14
to django-...@googlegroups.com
#23105: Cosmetic change on lru_cache backport
-------------------------------------+-------------------------------------
Reporter: areski | Owner: areski

Type: | Status: new
Cleanup/optimization | Version: master
Component: Utilities | Resolution:
Severity: Normal | Triage Stage:
Keywords: lru_cache | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by bmispelon):

What new features or bug fixes are we missing by using the "old" version?

From what I can tell, the original version was authored by Raymond
Hettinger (who wrote the original implementation) whereas this repository
is maintained by another person. How are the two projects related?

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

Django

unread,
Jul 26, 2014, 10:11:27 AM7/26/14
to django-...@googlegroups.com
#23105: Cosmetic change on lru_cache backport
-------------------------------------+-------------------------------------
Reporter: areski | Owner: areski

Type: | Status: new
Cleanup/optimization | Version: master
Component: Utilities | Resolution:
Severity: Normal | Triage Stage:
Keywords: lru_cache | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by areski):

It's likely that Raymond Hettinger won't be supporting this code from the
Activestate website.
The code has been ported unchanged to bitbucket by a different user, this
may change if someone come with some optimization or bugs fix, but it is
not the case so far.

Feel free to close the ticket if it's irrelevant or if it doesn't improve
Django code readability.

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

Django

unread,
Jul 26, 2014, 10:33:26 AM7/26/14
to django-...@googlegroups.com
#23105: Cosmetic change on lru_cache backport
-------------------------------------+-------------------------------------
Reporter: areski | Owner: areski

Type: | Status: new
Cleanup/optimization | Version: master
Component: Utilities | Resolution:
Severity: Normal | Triage Stage:
Keywords: lru_cache | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by areski):

It actually fix compatibility with Python2.6:
http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-
python-33s-lru-cache/#c3

But as Python2.6 support is dropped in Django 1.7, this doesnt give any
value

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

Django

unread,
Jul 26, 2014, 11:20:34 AM7/26/14
to django-...@googlegroups.com
#23105: Cosmetic change on lru_cache backport
-------------------------------------+-------------------------------------
Reporter: areski | Owner: areski
Type: | Status: closed
Cleanup/optimization | Version: master
Component: Utilities | Resolution: wontfix

Severity: Normal | Triage Stage:
Keywords: lru_cache | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bmispelon):

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


Comment:

I don't think that change is worth it.

We've already dropped support for Python 2.6 and eventually, we'll also
drop support for 2.7, at which point we'll be able to delete that file
altogether.

Marking this as `wontfix` consequently.

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

Reply all
Reply to author
Forward
0 new messages