#5769 closed defect (invalid)
power series are accidentally *mutable* (really dangerous)
Reported by: | was | Owned by: | somebody |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | basic arithmetic | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
wstein@sage:~/build/sage-3.4.1.rc2$ ./sage ---------------------------------------------------------------------- | Sage Version 3.4.1.rc2, Release Date: 2009-04-10 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- Loading Sage library. Current Mercurial branch is: ref2 sage: R.<t> = ZZ[[]] sage: f = 1 + 17*t - 4*t^3 + O(t^5) sage: f[1] = 10 ... IndexError: power series are immutable
Except they are mutable:
sage: f *= 2 sage: f 2 + 34*t - 8*t^3 + O(t^5)
But they shouldn't be! The _imul_ method needs to be deleted.
Change History (2)
comment:1 Changed 13 years ago by
Report Upstream: | → N/A |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 13 years ago by
Milestone: | sage-4.4.4 → sage-duplicate/invalid/wontfix |
---|
Note: See
TracTickets for help on using
tickets.
The code has nothing to do with mutability.
sage: a= (1,2,3)
a is a tuple, an immutable object
sage: a += a sage: a (1, 2, 3, 1, 2, 3)
sage: R.<t> = ZZ[[]] sage: f = 1 + 17*t - 4*t3 + O(t5) sage: g=f sage: g is f True sage: f+=f sage: f 2 + 34*t - 8*t3 + O(t5) sage: g 1 + 17*t - 4*t3 + O(t5) sage: f is g False