#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   |         Keywords:  homset, pickling
  Merged in:               |          Authors:  Nicolas M. ThiƩry
  Reviewers:               |  Report Upstream:  N/A
Work issues:               |           Branch:
     Commit:               |     Dependencies:
   Stopgaps:               |
---------------------------+-------------------------------------
 As was noticed in #14793, some sanity checks need to be disabled in Hom
 when called upon unpickling because the input may include an unitialized
 parent. Since #14793, this is achieved by looking at the parent to detect
 if it is unitilialized.

 As an alternative, this ticket proposes to add a ``check=True/False``
 optional argument to Hom, and to use it upon unpickling. The advantages
 are:

 - The logic is quite simpler, slightly faster, and more robust.

 - This check argument is of general purpose, and indeed immediately
   put to use when Hom calls itself recursively.

 - It made it easier for the first feature below

 A potential caveat: pickles created since #14793 might not unpickle
 properly. This was very recent; do we care?

 Other changes in this ticket:

 - Hom now uses ``X in category`` as sanity check rather than
   ``X.category().is_subcategory(category)``. This is more expressive,
   and indeed a necessary preliminary step for #15801 which makes those
   two idioms not always equivalent (example: `X` is a ``QQ``-module,
   ``X.category()`` is ``Modules(Rings)`` and ``category`` is
   ``Modules(QQ)``)

 - A bug fix for Homsets between simplicial complexes over some higher
   category (_Hom_ was not checking its input).

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