[Django] #33217: Add parentheses to @functools.lru_cache

9 views
Skip to first unread message

Django

unread,
Oct 21, 2021, 6:47:59 AM10/21/21
to django-...@googlegroups.com
#33217: Add parentheses to @functools.lru_cache
------------------------------------------------+------------------------
Reporter: jinsim | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Although python 3.6 and python 3.7 will be deleted, i think it would be
better to show the error phrase accurately.
As shown in the figure below, when using @functools.lru_cache in python
3.7 or lower, an unclean error occurs.
So i think it would be better to write @functools.lru_cache() until 3.6
and 3.7 are completely deleted.

https://drive.google.com/file/d/1SVUY8lTi4VOMdl-
LznO_H8Q6sCwDc1gU/view?usp=sharing
https://drive.google.com/file/d/1cvdSqJuMEJBwwD0kF-
Y_CEwgbArUkPqr/view?usp=sharing
https://drive.google.com/file/d/1C1AwEfF2-KifDOeAb1cewF57iBj1XbYb/view?usp=sharing

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

Django

unread,
Oct 21, 2021, 7:14:07 AM10/21/21
to django-...@googlegroups.com
#33217: Add parentheses to @functools.lru_cache
-------------------------------------+-------------------------------------
Reporter: Kim Beom Jin | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version: 4.0
Severity: Normal | Resolution: wontfix

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
* resolution: => wontfix
* component: Uncategorized => Core (Other)


Comment:

Python 3.6 and 3.7 are not supported by Django 4.0+, see
5bac1719a2fcbee5cb8b9e22c3480e3a24ed6c4c.

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

Django

unread,
Nov 26, 2021, 12:32:18 AM11/26/21
to django-...@googlegroups.com
#33217: Add parentheses to @functools.lru_cache
-------------------------------------+-------------------------------------
Reporter: Kim Beom Jin | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version: 4.0
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Kim Beom Jin):

Replying to [comment:1 Mariusz Felisiak]:
> Python 3.6 and 3.7 are not supported by Django 4.0+, see #32355 and
5bac1719a2fcbee5cb8b9e22c3480e3a24ed6c4c.

First of all, I'm really sorry for replying late because I didn't
recognize that the alarm had come.

I also know that Django doesn't support Python 3.8 or less from 4.0, but
users can't see proper error messages if Django doesn't put parentheses on
@functions.lru_cache.
Please refer to the picture I posted together with the ticket.

If it is the way it was, when the user follows the Django tutorial with a
version of 3.8 or less, 'TypeError: Expected max size to be integrated or
None' raises in lru_cache. However, if Django add parentheses to
lru_cache, users will see "ERROR: Package 'Django' requirement Python:
3.x.x not in '>=3.8'.
I think the latter is a better message for users.

Kind regards,
Beom Jin

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

Reply all
Reply to author
Forward
0 new messages