#18416: UniqueRepresentation issue with PowerSeriesRing
--------------------------+----------------------------
   Reporter:  vdelecroix  |            Owner:
       Type:  defect      |           Status:  new
   Priority:  critical    |        Milestone:  sage-6.7
  Component:  algebra     |         Keywords:
  Merged in:              |          Authors:
  Reviewers:              |  Report Upstream:  N/A
Work issues:              |           Branch:
     Commit:              |     Dependencies:
   Stopgaps:              |
--------------------------+----------------------------
 The power series ring (`sage.rings.power_series_ring.PowerSeriesRing`)
 inherits from `UniqueRepresentation`. In the argument of the constructor
 there is the precision (`prec`) but it can be modified! Which leads to
 wrong behavior
 {{{
 sage: R1 = PowerSeriesRing(QQ, 'x', 3)
 sage: R2 = PowerSeriesRing(QQ, 'x', 3)
 sage: R1 is R2
 True
 sage: R2 = PowerSeriesRing(QQ, 'x', 4)
 sage: R1 is R2
 False
 sage: R2.set_default_prec(3)
 sage: R1 == R2
 False
 }}}
 Moreover, a function can modify a power series in use
 {{{
 sage: def haha()
 ....:     PowerSeriesRing(QQ, 'x').set_default_prec(1)
 sage: R = PowerSeriesRing(QQ, 'x')
 sage: R.default_prec()
 20
 sage: haha()
 sage: R.default_prec()
 1
 }}}

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