#14793: Unique representation for homsets
-------------------------------+--------------------------------------------
       Reporter:  nthiery      |         Owner:  nthiery  
           Type:  enhancement  |        Status:  new      
       Priority:  major        |     Milestone:  sage-5.12
      Component:  categories   |    Resolution:           
       Keywords:               |   Work issues:           
Report Upstream:  N/A          |     Reviewers:           
        Authors:  Simon King   |     Merged in:           
   Dependencies:               |      Stopgaps:           
-------------------------------+--------------------------------------------

Comment (by SimonKing):

 It is a can of worms. The problem will always arise under the following
 conditions:

 - We have `Homset.__reduce__` returning `Hom, (self._domain,
 self._codomain, self.__category)`
 - We have a parent X whose pickling is done via pickling `__dict__` using
 the default Python way
 - `Hom(X,X)` (or any other homset involving X) is stored in `X.__dict__`.

 In this situation, unpickling X means that we have an uninitialised copy Y
 of X and want to call Hom(Y,Y).

 My previous suggestion was: "In Hom(X,Y,cat), if X.category() fails and
 cat is given, then trust that X will eventually become sufficiently
 initialised to see that X is in cat".

 Perhaps a modified suggestion is better: "In Hom(X,Y,cat), if X.category()
 fails, then at least test that X.__class__ is a subclass of
 cat.parent_class." This test is almost as good as `X in cat`, namely
 yields the same result unless a base ring is involved.

 Do you have a better suggestion? I really would not like to implement
 `__reduce__` methods everywhere in sage.schemes and sage.modular.

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