On Monday, 18 March 2013 05:49:11 UTC-4, Saullo Castro wrote:
>
> Dear Mr. Zhang, we are using a differential operator as you need, please 
> see more details on:
>
> http://stackoverflow.com/questions/15463412/matrix-of-differential-operators-in-python-module-sympy
>
> We could address it without changing the core classes in Sympy only when 
> the differential operator is used on the left side. When it is used on the 
> right side the method __mul__ in the core class Expr had to be changed.
> We are still looking for a Sympy native solution, though.
>
> Regards
>
>
>
_op_priority and the @call_highest_priority are there exactly for this 
purpose. Define it in your class with a value above 10.0, which is Expr's 
default value for it. Also define __rmul__, using the decorator 
@call_highest_priority. This will allow your class to control what happens 
during multiplication (left or right), but you will still run into subtle 
problems because multiplication != application, as already a mentioned 
couple of times.

Cheers,
Julien

-- 
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 http://groups.google.com/group/sympy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to