summaryrefslogtreecommitdiff
path: root/django/utils/functional.py
diff options
context:
space:
mode:
authorAdam Alton <adamalton@gmail.com>2017-05-15 14:05:42 +0100
committerTim Graham <timograham@gmail.com>2017-05-15 09:05:42 -0400
commitf9bae845eabd975a07e24d94e399299c1601acb7 (patch)
treee3f8aecaace09a819a71ae8b431f0e6d67c883e4 /django/utils/functional.py
parent3a5299c19cd5a38f7fa0f45ed2df7b10f0c9cf5d (diff)
downloaddjango-f9bae845eabd975a07e24d94e399299c1601acb7.tar.gz
Added a docstring to cached_property.__get__().
Diffstat (limited to 'django/utils/functional.py')
-rw-r--r--django/utils/functional.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/utils/functional.py b/django/utils/functional.py
index 92be506f3b..93c1cc1984 100644
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -26,6 +26,10 @@ class cached_property:
self.name = name or func.__name__
def __get__(self, instance, cls=None):
+ """
+ Call the function and replace this cached_property instance with the
+ return value so that the function and this method aren't called again.
+ """
if instance is None:
return self
res = instance.__dict__[self.name] = self.func(instance)