#4696: coercion system doesn't expect pickled parents
----------------------+-----------------------------------------------------
Reporter: burcin | Owner: robertwb
Type: defect | Status: new
Priority: minor | Milestone: sage-3.2.2
Component: coercion | Keywords:
----------------------+-----------------------------------------------------
The coercion system expects parents to be unique. This doesn't seem to
hold when pickled parents are involved.
{{{
sage: x,y = QQ['x,y'].gens()
sage: i = ideal(x^2 - y^2 + 1)
sage: j = loads(dumps(i))
sage: i == j
True
sage: j == i
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call
last)
/home/burcin/sage/sage-3.2.1.alpha2/local/lib/python2.5/site-
packages/sage/structure/element.so in
sage.structure.element.Element.__richcmp__
(sage/structure/element.c:5329)()
575
576
--> 577
578
579
/home/burcin/sage/sage-3.2.1.alpha2/local/lib/python2.5/site-
packages/sage/structure/element.so in
sage.structure.element.Element._richcmp (sage/structure/element.c:4807)()
516
517
--> 518
519
520
/home/burcin/sage/sage-3.2.1.alpha2/local/lib/python2.5/site-
packages/sage/structure/coerce.so in
sage.structure.coerce.CoercionModel_cache_maps.canonical_coercion
(sage/structure/coerce.c:6345)()
770
771
--> 772
773
774
/home/burcin/sage/sage-3.2.1.alpha2/local/lib/python2.5/site-
packages/sage/structure/coerce.so in
sage.structure.coerce.CoercionModel_cache_maps._coercion_error
(sage/structure/coerce.c:11109)()
1275
1276
-> 1277
1278
1279
RuntimeError: There is a bug in the coercion code in SAGE.
Both x (=Ideal (x^2 - y^2 + 1) of Multivariate Polynomial Ring in x, y
over Rational Field) and y (=Ideal (x^2 - y^2 + 1) of Multivariate
Polynomial Ring in x, y over Rational Field) are supposed to have
identical parents but they don't.
In fact, x has parent 'Monoid of ideals of Multivariate Polynomial Ring in
x, y over Rational Field'
whereas y has parent 'Monoid of ideals of Multivariate Polynomial Ring in
x, y over Rational Field'
Original elements Ideal (x^2 - y^2 + 1) of Multivariate Polynomial Ring in
x, y over Rational Field (parent Monoid of ideals of Multivariate
Polynomial Ring in x, y over Rational Field) and Ideal (x^2 - y^2 + 1) of
Multivariate Polynomial Ring in x, y over Rational Field (parent Monoid of
ideals of Multivariate Polynomial Ring in x, y over Rational Field) and
maps
<type 'NoneType'> None
<type 'sage.categories.morphism.CallMorphism'> Call morphism:
From: Monoid of ideals of Multivariate Polynomial Ring in x, y over
Rational Field
To: Monoid of ideals of Multivariate Polynomial Ring in x, y over
Rational Field
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4696>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---