id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
1440 [with patch, with positive review] Inconsistency in subs and substitute for univariate polynomials was broune "I very much agree that the problem below is a bug, which we should resolve.
{{{
subs and substitute are not equivalent for single variable
polynomials,
though they are in the field of fractions or for polynomials in more
than
one variable:
----------------------------------------------------------------------
| SAGE Version 2.8.15, Release Date: 2007-12-03 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: R. = QQ[]
sage: f = x^3 + x - 3
sage: f.subs(x = 5)
127
sage: f.substitute(x = 5)
---------------------------------------------------------------------------
Traceback (most recent call
last)
/Users/mafwc/ in ()
/Users/mafwc/element.pyx in
sage.structure.element.Element.substitute()
/Users/mafwc/polynomial_element.pyx in
sage.rings.polynomial.polynomial_element.Polynomial.subs()
/Users/mafwc/polynomial_element.pyx in
sage.rings.polynomial.polynomial_element.Polynomial.__call__()
: must not specify both a keyword and
positional argument
sage: g = f/(x - 1)
sage: [g.subs(x = 5), g.substitute(x = 5)]
[127/4, 127/4]
sage: R2. = PolynomialRing(QQ, 2)
sage: h = y^3*z + 4*y*z^2 + y + 3*z - 7
sage: [h.subs(y = 5), h.substitute(y = 5)]
[20*z^2 + 128*z - 2, 20*z^2 + 128*z - 2]
[Mac OS X 10.4.11, 2 GHz Intel Core 2 Duo, 1 GB].
}}}" defect closed major sage-3.0.3 basic arithmetic fixed