#15223: Let the `TestSuite` test that the construction of a parent returns the
parent
-------------------------------------+-------------------------------------
       Reporter:  SimonKing          |        Owner:
           Type:  defect             |       Status:  new
       Priority:  major              |    Milestone:  sage-5.12
      Component:  coercion           |   Resolution:
       Keywords:                     |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/SimonKing/ticket/15223           |  a81fcc1072df88cc369d7aa0b7ae423fd97d7f02
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nbruin):

 Replying to [comment:13 SimonKing]:
 > No, it is not !UniqueRepresentation:
 > {{{
 > sage: isinstance(A,UniqueRepresentation)
 > False
 > }}}
 That doesn't tell the entire story, though:
 {{{
 sage: type(IntegerModRing).mro()
 [sage.rings.finite_rings.integer_mod_ring.IntegerModFactory,
  sage.structure.factory.UniqueFactory,
  sage.structure.sage_object.SageObject,
  object]
 }}}
 so perhaps the ''object'' isn't really !UniqueRepresentation but the
 ''system'' tries to implement the semantics via a factory. So I think
 you're seeing exactly the problem I was afraid of:
 {{{
 sage: A1=IntegerModRing(19)
 sage: A2=IntegerModRing(19)
 sage: B1=IntegerModRing(19,category=Fields())
 sage: B2=IntegerModRing(19,category=Fields())
 sage: A1 is A2
 True
 sage: B1 is B2
 True
 sage: A1 in Fields()
 True
 sage: type(A1)
 <class
 
'sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic_with_category'>
 sage: type(B1)
 <class
 
'sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic_with_category'>
 sage: type(A1) == type(B1)
 False
 }}}
 so after this we do have two functionally equivalent copies of the same
 ring: `A1,B1`, but they are not identical. Furthermore, their types are
 not identical or equal either, but it's hard to see what the difference is
 between them (note `A1.__cmp__` to see that this last `False` is the
 reason why `A1 != B1`.

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