Opened 5 years ago
Last modified 3 weeks ago
#18416 new defect
UniqueRepresentation issue with PowerSeriesRing
Reported by: | vdelecroix | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | sage-9.1 |
Component: | algebra | Keywords: | |
Cc: | niles, SimonKing | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
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: R = PowerSeriesRing(QQ, 'x', 3) sage: R.default_prec() 3 sage: R.set_default_prec(19) sage: PowerSeriesRing(QQ, 'x', 3).default_prec() 19
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
Change History (9)
comment:1 Changed 5 years ago by
- Description modified (diff)
comment:2 Changed 5 years ago by
- Cc niles SimonKing added
comment:3 Changed 11 months ago by
- Milestone changed from sage-6.7 to sage-8.7
comment:4 Changed 11 months ago by
+1 on deprecating the set_default_prec
for PowerSeriesRing
for the same reasons as for LaurentSeriesRing
.
comment:5 Changed 11 months ago by
Even worse in terms of hidden side effects:
sage: R.<x> = LaurentSeriesRing(QQ,50) sage: R.default_prec() 50 sage: S = PowerSeriesRing(QQ,50,names='x') sage: S.set_default_prec(10) sage: R.default_prec() 10
comment:6 Changed 11 months ago by
yes, this should definitely be changed
comment:7 Changed 10 months ago by
- Milestone changed from sage-8.7 to sage-8.8
Moving all blocker/critical issues from 8.7 to 8.8.
comment:8 Changed 7 months ago by
- Milestone changed from sage-8.8 to sage-8.9
Moving open critical and blocker issues to the next release milestone (optimistically).
comment:9 Changed 3 weeks ago by
- Milestone changed from sage-8.9 to sage-9.1
Ticket retargeted after milestone closed
Does anyone know the status of this?
The corresponding behavior for LaurentSeries? was deprecated in #16201 (which also mentions power series) and finally removed in #26915 .
So now we are in the situation where PowerSeries? and LaurentSeries? work quite differently here, I can't see any real reason for this.