This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Epic_Wink
Recipients Epic_Wink
Date 2019-10-21.11:32:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1571657555.74.0.0439676039555.issue38545@roundup.psfhosted.org>
In-reply-to
Content
Turns out, that as a non-data descriptor, a cached property already has setting/updating and clearing through the normal mechanisms in Python. This feature request is therefore redundant: perhaps a new issue to document this inherent behaviour?

Unless you explicitly want to make cached property updating not allowed, but that's easily implemented in application code by sub-classing `functools.cached_property` and defining `__set__` and `__delete__` to raise:

    class unupdatable_cached_property(functools.cached_property):
        def __set__(self, instance, value):
            raise AttributeError("can't set attribute")

        def __delete__(self, instance):
            raise AttributeError("can't delete attribute")
History
Date User Action Args
2019-10-21 11:32:35Epic_Winksetrecipients: + Epic_Wink
2019-10-21 11:32:35Epic_Winksetmessageid: <1571657555.74.0.0439676039555.issue38545@roundup.psfhosted.org>
2019-10-21 11:32:35Epic_Winklinkissue38545 messages
2019-10-21 11:32:35Epic_Winkcreate