Re: [sage-devel] A question on pickling cached methods

2019-06-27 Thread Kwankyu Lee
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

Re: [sage-devel] A question on pickling cached methods

2019-06-27 Thread John Cremona
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

[sage-devel] A question on pickling cached methods

2019-06-26 Thread Kwankyu Lee
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.