[Django] #34270: Use @functools.cache instead of @functools.lru_cache(maxsize=None)

6 views
Skip to first unread message

Django

unread,
Jan 18, 2023, 7:22:52 AM1/18/23
to django-...@googlegroups.com
#34270: Use @functools.cache instead of @functools.lru_cache(maxsize=None)
------------------------------------------------+------------------------
Reporter: hugovk | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
`functools.cache` was added in Python 3.9 and returns the same as
`functools.lru_cache(maxsize=None)`

https://docs.python.org/3/library/functools.html#functools.cache

Now Python 3.10 is the lowest supported version for Django 5.0, let's use
the shorter one.

https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-
can-i-use-with-django

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

Django

unread,
Jan 18, 2023, 7:26:51 AM1/18/23
to django-...@googlegroups.com
#34270: Use @functools.cache instead of @functools.lru_cache(maxsize=None)
-------------------------------------+-------------------------------------
Reporter: Hugo van Kemenade | Owner: nobody
Type: | Status: closed
Cleanup/optimization |

Component: Core (Other) | Version: dev
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

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

* status: new => closed
* has_patch: 1 => 0
* resolution: => duplicate


Comment:

Duplicate of #34233.

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

Django

unread,
Jan 18, 2023, 7:28:29 AM1/18/23
to django-...@googlegroups.com
#34270: Use @functools.cache instead of @functools.lru_cache(maxsize=None)
-------------------------------------+-------------------------------------
Reporter: Hugo van Kemenade | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version: dev
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hugo van Kemenade):

* has_patch: 0 => 1


Comment:

PR https://github.com/django/django/pull/16482 is a duplicate of
https://github.com/django/django/pull/16480, so closing this ticket as a
duplicate of https://code.djangoproject.com/ticket/34233.

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

Reply all
Reply to author
Forward
0 new messages