#16316: cached_function and cached_method for unhashable elements
-------------------------------------+-------------------------------------
Reporter: saraedum | Owner:
Type: enhancement | Status: needs_work
Priority: minor | Milestone: sage-6.3
Component: misc | Resolution:
Keywords: | Merged in:
Authors: Julian Rueth | Reviewers: Peter Bruin
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/saraedum/ticket/16316 | c0ab188bd2b54ff81eb3925d417aae7f3c6626f5
Dependencies: #16251 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by saraedum):
It seems to me that the only option to resolve the issue with `id(parent)`
is to include the actual parent in the cache key.
This is not very nice for performance, but assuming that cached results
are fairly expensive to calculate it is probably the best solution. The
whole machinery is only really relevant for p-adics at the moment. If we
ever run into performance issues because the parents are cached, then we
can still add a parameter to `@cached_method` which strips the parent from
the cache key (e.g. because the function checks that all inputs belong to
the same parent.) For the moment I would rather not implement such
functionality which solves performance issues which we do not have yet.
----
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=c0ab188bd2b54ff81eb3925d417aae7f3c6626f5
c0ab188]||{{{fixed docstring}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/16316#comment:25>
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.