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

On Thu, 27 Jun 2019 at 04:07, Kwankyu Lee <ekwan...@gmail.com> wrote:

> 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.
>
> Is it possible to implement genus() to behave in such a way? Is there some
> option to @cached_method decorator for that purpose?
>
> I am reading the code for cached methods, but you answer will help me.
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/933290b2-697e-4766-9f28-d0486a585107%40googlegroups.com
> <https://groups.google.com/d/msgid/sage-devel/933290b2-697e-4766-9f28-d0486a585107%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAD0p0K6HPBdPi-jxQLkPTu76Hg9EvKb7rBxJ_rbM6M8sgp947w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to