On Sun, Oct 4, 2015 at 3:12 PM, Francesco Bonazzi <[email protected]> wrote: > On Sunday, 4 October 2015 19:30:43 UTC+2, Aaron Meurer wrote: >> There's no precedence for it as far as I know. The operator was only >> designed for matrix multiplication (which, by the way, we ought to >> implement it for Matrix). > > > Mathematica uses it for function composition.
But we have to match the Python conventions, not the Mathematica ones. For instance, @ has the same precedence as * and is left associative, and this can't be changed. > > >> There is a technical challenge in that functions in SymPy are >> typically classes, meaning the operator would have to be defined on >> the metaclass. We've been trying to get rid of our metaclasses because >> they can slow things down and they make the code more confusing. I >> believe it is doable, though. >> > > Maybe we need two classes: function (no arguments specified) and function > with args. Having functions be objects has been a long standing issue (https://github.com/sympy/sympy/issues/4787). I think it's doable, but it would break any code that makes incorrect assumptions about the relationship between an expression, its function, and its class (for instance, using type(expr) or expr.__class__ instead of expr.func to rebuild the expression). 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/00e21857-ff99-4a63-94f2-b8264a16abe1%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6J7wH7RE3VEA0kczsgSkJZCx5JK3-NL-iaO5dnBitQmnw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
