#33217 closed Cleanup/optimization (wontfix)
Add parentheses to @functools.lru_cache
Reported by: | Kim Beom Jin | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 4.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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
Change History (2)
follow-up: 2 comment:1 by , 3 years ago
Component: | Uncategorized → Core (Other) |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
comment:2 by , 3 years ago
Replying to 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.7 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
Python 3.6 and 3.7 are not supported by Django 4.0+, see 5bac1719a2fcbee5cb8b9e22c3480e3a24ed6c4c.