#13394: Write a WeakValueDictionary with safer key removal
-------------------------------------+-------------------------------------
Reporter: nbruin | Owner: rlm
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.13
Component: memleak | Resolution:
Keywords: | Merged in:
Authors: Simon King, Nils | Reviewers: Simon King
Bruin | Work issues:
Report Upstream: None of the above | Commit:
- read trac for reasoning. | 851cc9522dde332561101f1c84182a0a84b8eed4
Branch: | Stopgaps:
u/SimonKing/ticket/13394 |
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by nbruin):
Replying to [comment:70 SimonKing]:
> No, I think it is usual in sage to have indirect doctests for cdef
functions. And we do have indirect tests in this case.
I don't think the indirect tests are thorough enough in this case.
The implicit tests that we have presently probably don't exercise the
probing function at all (we probably find what we're looking for or NULL
on the first try)
I would like to see the test I wrote, or something similar, in the regular
test suite (perhaps scaled down a bit or marked `#long` if it's too
expensive in its present form). We are relying here on implementation
details that python doesn't explicitly guarantee.
I am taking keys and values from the same list so that there's a chance to
screw up the dictionary if they inadvertently get confused (i.e., if the
layout of `mp.ma_table` changes).
Why waste effort on trying to come up with an indirect test if you can
just test it directly? Call the routine
`_test_of_del_dict_dont_bother_calling_this_for_other_reasons` if you
like.
I think the semantics of the routine are well-defined, though, so we
shouldn't go out of our way to hide it.
--
Ticket URL: <http://trac.sagemath.org/ticket/13394#comment:72>
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/groups/opt_out.