#16316: cached_function and cached_method for unhashable elements
-------------------------------------+-------------------------------------
Reporter: saraedum | Owner:
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-6.3
Component: misc | Resolution:
Keywords: | Merged in:
Authors: Julian Rueth | Reviewers: Peter Bruin, Travis
Report Upstream: N/A | Scrimshaw
Branch: | Work issues:
u/tscrim/ticket/16316 | Commit:
Dependencies: #16251 | 7a9a6b2a3e4a68bfd3c9d8d6556a883e1d1161e0
| Stopgaps:
-------------------------------------+-------------------------------------
Comment (by pbruin):
Replying to [comment:23 saraedum]:
> Replying to [comment:22 tscrim]:
> > - I'm pretty sure using the parent's `id` will break pickling with the
cache. So suppose you create parent `A`, store an element `a` in a cache
`C`. Now you pickle and unpickle `a`, `A`, and `C`. The `id` of `A` is
different than before the pickle and unpickling, so we are no longer able
to retrieve `a` from `C`:
> I agree. This is a very serious problem.
Hmm, I see. But if we store the parent itself, then I think we have to
make sure that all unhashable elements belong to parents satisfying unique
representation. Otherwise, calling a cached function on an element whose
parent is equal but not identical to the parent of an element that was
used before could return a cached result that lives in this equal-but-not-
identical parent.
--
Ticket URL: <http://trac.sagemath.org/ticket/16316#comment:34>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.