First time here? Check out the FAQ!
answered 4 years ago
Note that you can also use Python dicts instead of symbolic expressions, which is usually more robust for complex substitutions :
sage: def test(self, symb): ....: return self-self.subs({symb: symb-1})