#2952: [with patch, needs work] LaurentPolynomialRing coercion error
----------------------+-----------------------------------------------------
 Reporter:  mhansen   |        Owner:  roed      
     Type:  defect    |       Status:  new       
 Priority:  critical  |    Milestone:  sage-3.1.3
Component:  coercion  |   Resolution:            
 Keywords:            |  
----------------------+-----------------------------------------------------
Changes (by mabshoff):

  * summary:  LaurentPolynomialRing coercion error => [with patch, needs
              work] LaurentPolynomialRing coercion error

Comment:

 This is still broken and the new coercion framework has been merged:
 {{{
 | SAGE Version 3.1.2.rc2, Release Date: 2008-09-12                   |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------

 sage: R.<q>=QQ[]
 sage: L.<x,y,z> = LaurentPolynomialRing(R)
 sage:
 sage: f=(x+y+z^-1)^2
 sage: f.substitute(z=1)
 ---------------------------------------------------------------------------
 NameError                                 Traceback (most recent call
 last)

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/<ipython console> in
 <module>()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/element.pyx in
 sage.structure.element.Element.substitute
 (sage/structure/element.c:3756)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/laurent_polynomial.pyx in
 sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_mpair.subs
 (sage/rings/polynomial/laurent_polynomial.c:6666)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/element.pyx in
 sage.structure.element.RingElement.__imul__
 (sage/structure/element.c:9590)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/coerce.pyx in
 sage.structure.coerce.CoercionModel_cache_maps.bin_op
 (sage/structure/coerce.c:6008)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/coerce.pyx in
 sage.structure.coerce.CoercionModel_cache_maps.get_action
 (sage/structure/coerce.c:9310)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/coerce.pyx in
 sage.structure.coerce.CoercionModel_cache_maps.discover_action
 (sage/structure/coerce.c:10441)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/coerce.pyx in
 sage.structure.coerce.CoercionModel_cache_maps.discover_action
 (sage/structure/coerce.c:10088)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/parent.pyx in
 sage.structure.parent.Parent.get_action (sage/structure/parent.c:8569)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/parent_old.pyx in
 sage.structure.parent_old.Parent._get_action_
 (sage/structure/parent_old.c:5963)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/parent_old.pyx in
 sage.structure.parent_old.Parent.get_action_c
 (sage/structure/parent_old.c:2264)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/parent_old.pyx in
 sage.structure.parent_old.Parent.get_action_impl
 (sage/structure/parent_old.c:2481)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/parent_old.pyx in
 sage.structure.parent_old.Parent.get_action_c_impl
 (sage/structure/parent_old.c:3341)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/coerce_actions.pyx in
 sage.structure.coerce_actions.ModuleAction.__init__
 (sage/structure/coerce_actions.c:3706)()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/local/lib/python2.5/site-
 packages/sage/categories/pushout.py in pushout(R, S)
     437         if len(Sc) == 0:
     438             c = Rc.pop()
 --> 439             Z = c(Z)
     440         elif len(Rc) == 0:
     441             c = Sc.pop()

 /scratch/mabshoff/release-cycle/sage-3.1.2.rc3/local/lib/python2.5/site-
 packages/sage/categories/pushout.py in __call__(self, R)
     136             return LaurentPolynomialRing(R.base_ring(),
 (list(R.variable_names()) + [self.var]))
     137         else:
 --> 138             return PolynomialRing(R, self.var)
     139     def __cmp__(self, other):
     140         c = cmp(type(self), type(other))

 NameError: global name 'PolynomialRing' is not defined
 sage:
 }}}
 It seems that David's patch is not the right solution, so can someone come
 up with a better patch?

 Cheers,

 Michael

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

Reply via email to