There is a distribute() context manager which lets you disable
automatic distribution, though it's not pretty:
>>> from sympy.core.parameters import distribute
>>> with distribute(False):
... print(expr.diff(t))
3*a*(t - t0)**2 + 2*b*(t - t0)
While this is less dangerous than the similar evaluate() context
manager, it is possible this could break something if you put too much
under the context.
As Chris said, we do want to eventually remove this automatic
behavior, but it hasn't been easy to do as a lot of things depend on
it currently. Rearranging things after the fact as Chris suggests is
probably the better solution. There's really no guarantees about what
the form of an expression from diff() will look like.
Aaron Meurer
> --
> 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
sympy+un...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/389f5dd9-1498-455a-b6cc-ffbbff89a9d7n%40googlegroups.com.