#16316: cached_function and cached_method for unhashable elements
-------------------------------------+-------------------------------------
Reporter: saraedum | Owner:
Type: enhancement | Status: positive_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/saraedum/ticket/16316 | Commit:
Dependencies: #16251 | 83944fabe78c5561f0cc5b0845d5e8bdb30098c2
| Stopgaps:
-------------------------------------+-------------------------------------
Changes (by tscrim):
* status: needs_work => positive_review
Comment:
Ah, now I see why you're trying to hash every time inside of the function
`_cache_key`, which is why `SageObject._cache_key` should be the thing
raising the error. Although what I had before, with proper placement in
the class hierarchy, would not have unpacked the polynomial. Defining
`_cache_key` for ''all'' polynomials led to some of my confusion before.
I'm also not in favor of raising an error in `SageObject._cache_key`
because an object is unhashable. What I had before allowed more
flexibility is use, say I wanted to do my own custom cache which uses the
`_cache_key` method.
So overall I feel like this is a heavy-handed approach. However I don't
have a strong enough use case to oppose this getting in as is. So positive
review.
--
Ticket URL: <http://trac.sagemath.org/ticket/16316#comment:37>
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.