First time here? Check out the FAQ!
answered 2020-04-14 13:08:00 +0100
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})