#14738: Several related solve fixes or better doc related to keywords
-----------------------------+----------------------------------------------
Reporter: kcrisman | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone: sage-5.11
Component: symbolics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
-----------------------------+----------------------------------------------
Comment (by kcrisman):
Aack! What the heck?
{{{
sage: for eq in X:
....: print eq._maxima_().to_poly_solve(x).sage()
....:
[[x == 3/4*pi + 2*pi*z637], [x == -1/4*pi + 2*pi*z639]]
[[x == 2*pi*z647], [x == -1/2*pi + 2*pi*z649]]
}}}
but
{{{
sage: for eq in X:
Y = eq._maxima_().to_poly_solve(x).sage()
....: X.remove(eq)
....:
sage: X
[sin(x) == cos(x) - 1]
}}}
We are totally abusing `list.remove()` here.
{{{
sage: L = [1,2,3]
sage: for l in L:
L.remove(l)
....:
sage: L
[2]
}}}
Yikes. See e.g. [http://stackoverflow.com/questions/8745130/list-remove-
method-not-providing-expected-results this stackoverflow question]; we
should not be changing a list while iterating over it.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14738#comment:1>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.