@lru_cache(<NUM_LIT>)<EOL><INDENT>def subs_consts(self, expr):<DEDENT>
if isinstance(expr, numbers.Number):<EOL><INDENT>return expr<EOL><DEDENT>else:<EOL><INDENT>return expr.subs(self.constants)<EOL><DEDENT>
Substitute constants in expression unless it is already a number.