#35743: Add a method to cached_property for clearing its cached value
-------------------------------+-----------------------------------------
Reporter: Jae Hyuck Sa | Owner: Jae Hyuck Sa
Type: New feature | Status: assigned
Component: Utilities | Version: 5.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Description changed by Jae Hyuck Sa :
Old description:
> I would like to propose an enhancement to Django's cached_property.
> Currently, cached_property does not provide a built-in way to clear its
> cached value from an instance. To reset the cached value, developers must
> manually delete the property from the instance's __dict__.
>
> This proposal was inspired by a suggestion made by Jacob Tyler Walls on
> [this pull
> request](https://github.com/django/django/pull/18534#:~:text=5%20days%20ago-,jacobtylerwalls%20reviewed%204%20days%20ago,-View%20reviewed%20changes),
> where it was recommended to expose this functionality on cached_property
> rather than implementing it individually for each property.
>
> By incorporating this functionality, developers can avoid implementing
> custom methods for each property, which will promote cleaner and more
> maintainable code.
>
> Feedback and suggestions from the community are greatly appreciated!
New description:
I would like to propose an enhancement to Django's cached_property.
Currently, cached_property does not provide a built-in way to clear its
cached value from an instance. To reset the cached value, developers must
manually delete the property from the instance's __dict__.
This proposal was inspired by a suggestion made by Jacob Tyler Walls on
this pull
request(https://github.com/django/django/pull/18534#:~:text=5%20days%20ago-,jacobtylerwalls%20reviewed%204%20days%20ago,-View%20reviewed%20changes),
where it was recommended to expose this functionality on cached_property
rather than implementing it individually for each property.
By incorporating this functionality, developers can avoid implementing
custom methods for each property, which will promote cleaner and more
maintainable code.
Feedback and suggestions from the community are greatly appreciated!
--
--
Ticket URL: <https://code.djangoproject.com/ticket/35743#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070191d1fc5dbb-b7b402df-8ca9-41eb-ae17-f13a584afaa4-000000%40eu-central-1.amazonses.com.