#715: Parents probably not reclaimed due to too much caching
------------------------+---------------------------------------------------
Reporter: robertwb | Owner: somebody
Type: defect | Status: needs_info
Priority: major | Milestone: sage-5.0
Component: coercion | Keywords: weak cache coercion
Work_issues: | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #9138, #11900
------------------------+---------------------------------------------------
Changes (by jpflori):
* status: needs_review => needs_info
Comment:
Ive finally read your code and have to say bravo!
However I've got one request, or rather one question.
With the current implementation, Actions always use a weak ref for the
underlying set so that it can and will be garbage collected if it is not
strong refed elsewhere.
You illustrate and mention that in some examples in action.pyx.
You also modify an example involving Action and MatrixSpace to make sure
that no gc occurs.
I do not think this is the right solution, I mean that the user should be
able to use Action has before (and anyway it does not feel right to me
that you can create something that can magically disappear).
You could also argue that nobody actually uses Actions directly (I do not
for example :) ), those who do will have to be careful.
I see two solutions:
* Add a big fat warning in Action documentation (red, in a bloc, at the
start, etc.)
* Implement somehow an option to choose whether to use weak ref (which
will be set for the coercion model) or strong ones (set by default, so the
"normal" and previous behaviour will be the default one). It basically
mean passing an additional boolean somehow which will lead the
construction of underlying_set, be saved and modify the behavior of
underlying_set() (i.e. add () or not)
What does everybody thinks ?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/715#comment:142>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.