On Wednesday, 17 February 2016 19:45:57 UTC+1, Aaron Meurer wrote: > > > But func isn't the only way an evaluation might happen. An algorithm > might try to pull apart the expression and use the terms in different > ways (for example, an algorithm that does the transformation a**x*a**y > -> a**(x + y) extracts the parts from the two powers and creates a new > one). The only way to prevent this in general is to hide the fact that > it's a Pow, but if you do that, you lose the ability to perform some > computations. >
Yes, you may seal the expression tree inside a held object. In the case of *Pow*, the unevaluated expression may have the arguments that you would generally pass to *Pow*, and maybe even inherit *Pow* or have a *__getattr__ *that calls *Pow* back. It should be thought of a bit, but I believe this could be feasible. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/05e2eb52-1856-4ae4-8c18-6bb0189e8550%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
