Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I agree that f.subs(a == 3) is bad syntax and should probably be deprecated. For substitutions, it is much clearer to use a Python dictionary:

sage: a, b = var('a b')
sage: f = a*x + b
sage: f.subs({a: 3, b: -2})
3*x - 2

I agree that f.subs(a == 3) is bad syntax and should probably be deprecated. For substitutions, it is much clearer to use a Python dictionary:

sage: a, b = var('a b')
sage: f = a*x + b
sage: f.subs({a: 3})
b + 3*x
sage: f.subs({a: 3, b: -2})
3*x - 2