On Thursday, June 27, 2019 at 4:41:30 PM UTC+9, John Cremona wrote:
>
> I think this is one disadvantage of using the cached_method decorator,
> instead of the clumsier way of actually storing the result in the object,
> eg. by setting X._genus. In your example I cannot think of a reason why w
I think this is one disadvantage of using the cached_method decorator,
instead of the clumsier way of actually storing the result in the object,
eg. by setting X._genus. In your example I cannot think of a reason why we
would not want to store the genus as an attribute after computing it.
John
O
Hi,
Suppose I have an object X. I computed X.genus(), which took a long time.
The method genus() is a cached method. So it gives the result quickly next
time. Then I saved the object X. After loading X in a new session, I want
X.genus() to give the cached result rather than computing it again.