#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         |    Reviewers:
Report Upstream:  None of the above  |  Work issues:
  - read trac for reasoning.         |       Commit:
         Branch:                     |  c3dba989f73c1eec0a66cf72ae203132fe33b5da
  u/SimonKing/ticket/13394           |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 I currently believe that `D.pop(k)` should return `D[k]` regardless
 whether we are iterating or not. But ''if'' we are iterating, then
 deletion of `D[k]` should be postponed. Also `D.popitem()` should return
 an item and postpone deletion if we are iterating.

 Note that `D[k]` should include a test whether the item is waiting to be
 deleted, and in this case raise a key error. Similarly, the iteration
 methods should only iterate over items that are not (yet) waiting to be
 deleted.

--
Ticket URL: <http://trac.sagemath.org/ticket/13394#comment:22>
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.

Reply via email to