#35745: Improve Documentation on Clearing Cached Property Values
-------------------------------+-----------------------------------------
Reporter: Jae Hyuck Sa | Owner: Jae Hyuck Sa
Type: Uncategorized | Status: closed
Component: Documentation | Version: 5.1
Severity: Normal | Resolution: invalid
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 Sarah Boyce):
* resolution: => invalid
* status: assigned => closed
Comment:
From what I understand, I think this is documented:
https://docs.djangoproject.com/en/5.1/ref/utils/#django.utils.functional.cached_property
> The cached value can be treated like an ordinary attribute of the
instance:
>
> {{{#!python
> # clear it, requiring re-computation next time it's called
> del person.friends # or delattr(person, "friends")
>
> # set a value manually, that will persist on the instance until cleared
> person.friends = ["Huckleberry Finn", "Tom Sawyer"]
> }}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35745#comment:3>
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/01070191d57d9f8d-37220dc2-925d-4f0d-b984-cb495c6f783b-000000%40eu-central-1.amazonses.com.