#10963: More functorial constructions
-------------------------------------+-------------------------------------
       Reporter:  nthiery            |        Owner:  stumpc5
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:
      Component:  categories         |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Nicolas M. ThiƩry  |    Reviewers:  Simon King
Report Upstream:  N/A                |  Work issues:  Reduce startup time
         Branch:                     |  by 5%. Avoid "recursion depth
   Dependencies:  #11224, #8327,     |  exceeded (ignored)".
  #10193, #12895, #14516, #14722,    |       Commit:
  #13589, #14471                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by SimonKing):

 * cc: vbraun, nbruin (added)


Comment:

 Hmmmm. It is not as easy as I thought. Therefore I put Volker and Nils on
 Cc, because they know a lot more on Python than I do.

 By inserting print statements, I verified that with unpatched Sage in the
 `MonoDict` example, the eraser is called recursively: When invoking the
 eraser for a key K1, the deletion of the key-value pair (K1,K2) results in
 calling the eraser for K2 ''before'' the eraser of K1 has finished. Hence,
 the order is like this:
 - the eraser is called recursively, because a deletion happening inside of
 the eraser triggers the call to the next eraser.
 - the `RuntimeError` is reported after the last deletion has happened
 - after reporting the error, the 1000 nested erasers return one after the
 other.

 With a tentative patch, I can make the callback function work in a
 seemingly good way: The eraser is invoked for a key K1, and by assigning
 K2 to a local variable, the key-value pair (K1,K2) can be "safely"
 removed. The order is like this:
 - one eraser is called, and inside of it a deletion happens.
 - the next eraser is only called after when the first eraser returns.

 And now comes the big surprise: In the very end, the `RuntimeError` is
 still reported! Even though the the inserted print statements show that
 the calls are not nested!

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