#16275: Hom: introduce a check argument to simplify the unpickling detection 
logic
-------------------------------------+-------------------------------------
       Reporter:  nthiery            |        Owner:
           Type:  enhancement        |       Status:  new
       Priority:  major              |    Milestone:  sage-6.2
      Component:  categories         |   Resolution:
       Keywords:  homset, pickling   |    Merged in:
        Authors:  Nicolas M. ThiƩry  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  
u/nthiery/hom__introduce_a_check_argument_to_simplify_the_unpickling_detection_logic|
  ae3ca8080a8412891722695d1e24e1dfe374d787
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nthiery):

 Replying to [comment:9 SimonKing]:
 > I think explicit is better than implicit. Moreover, it has another use
 case (as demonstrated by Nicolas) and should also be faster than the old
 solution. Hence, I am all in favour of the new solution.

 Glad we are on the same line :-) And thanks for checking and investigating
 further!

 > The only problem is: (How) Do we care about old pickles whose unpickling
 requires to skip the assertion, but which are unaware of the "check=False"
 argument?
 >
 > I suggest the following scheme:
 > {{{
 >     if check:
 >         if domain not in category:
 >             if domain's category is initialised:
 >                 raise error, since that means we are not unpickling an
 old pickle
 >         if codomain not in category:
 >             if codomain's category is initialised:
 >                 raise error
 >     proceed with creating the homset
 > }}}
 > Hence, the assertion is skipped if this is explicitly requested, and
 before raising an actual error it is verified if we need to skip the
 assertion implicitly.

 One thing: `domain not in category` will possibly call
 `domain.category()` with the caveats that were mentioned on #14793.
 Not sure how much we should care.

 As to how important it is to actually do something about this: what's
 the time period during which pickles may have been created that can't
 be unpickled with the check=False approach?

 Cheers,
                                 Nicolas

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

Reply via email to