Opened 10 years ago

Closed 10 years ago

#23105 closed Cleanup/optimization (wontfix)

Cosmetic change on lru_cache backport

Reported by: Areski Belaid Owned by: Areski Belaid
Component: Utilities Version: dev
Severity: Normal Keywords: lru_cache
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (5)

comment:2 by Baptiste Mispelon, 10 years ago

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?

comment:3 by Areski Belaid, 10 years ago

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.

comment:4 by Areski Belaid, 10 years ago

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

comment:5 by Baptiste Mispelon, 10 years ago

Resolution: wontfix
Status: newclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top