#16316: cached_function and cached_method for unhashable elements
-------------------------------------+-------------------------------------
Reporter: saraedum | Owner:
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-6.2
Component: misc | Resolution:
Keywords: | Merged in:
Authors: Julian Rueth | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/saraedum/ticket/16316 | 877302ec5744433ccdd079552a7aaf1300a438ad
Dependencies: #16251 | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by tscrim):
* cc: SimonKing (added)
Comment:
Your proposal is not nearly as scary as your description would indicate.
We do not want to cache unhashable things (in fact, we can't). Instead
what you're doing is creating a generic method `_create_key`, which is the
default key when the object being passed to a `@cached_function`. For
example, this would allow us to have matrices/graphs automatically return
immutable copies of themselves (something I think I could leverage and
find useful for passing through `UniqueRepresentation.__classcall__`).
I'm thinking we should also do automatic conversions for mutable python
objects such as `list -> tuple` and `set -> frozenset`. Yet we should make
really sure that we're not slowing things down in doing this. Similar for
memory leaks.
Simon, do you have any thoughts on this?
--
Ticket URL: <http://trac.sagemath.org/ticket/16316#comment:5>
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.