How property caching works in the following code?
<p>I'm confused about the following code snippet how it works? It's a decorator and it will lazily initialize the property and then use the cached property on next requests. Looking at the code, it seems that it will always call the self.method? A little explanation will be helpful</p>

<pre><code>class cached_property(object):
    def __init__(self, method, name=None):
        self.method = method
        self.name = name or method.__name__
        self.__doc__ = method.__doc__
    def __get__(self, inst, cls):
        if inst is None:
            return self
        result = self.method(inst)
        setattr(inst, self.name, result)
        return result
</code></pre>
