summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2018-07-09 21:13:31 +0500
committerTim Graham <timograham@gmail.com>2018-07-09 12:13:31 -0400
commit09199734d383691ecf6d163894b447ca45e0ef82 (patch)
treed3b5028c6d9c866648efeb8af4d9eab29f9c94e7 /docs/ref
parent37835883ad55b3c4c3340eb8721b41fffe3ee0ef (diff)
Refs #29478 -- Doc'd how to use cached_property with a mangled name.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/utils.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt
index 5f971e3322..51530ab845 100644
--- a/docs/ref/utils.txt
+++ b/docs/ref/utils.txt
@@ -501,6 +501,15 @@ https://web.archive.org/web/20110718035220/http://diveintomark.org/archives/2004
z = person.friends # does not call
x is z # is True
+ .. warning::
+
+ ``cached_property`` doesn't work properly with a mangled__ name unless
+ it's passed a ``name`` of the form ``_Class__attribute``::
+
+ __friends = cached_property(get_friends, name='_Person__friends')
+
+ __ https://docs.python.org/3/faq/programming.html#i-try-to-use-spam-and-i-get-an-error-about-someclassname-spam
+
.. function:: keep_lazy(func, *resultclasses)
Django offers many utility functions (particularly in ``django.utils``)