On Sun, Oct 4, 2015 at 3:12 PM, Francesco Bonazzi
<
franz....@gmail.com> 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
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/00e21857-ff99-4a63-94f2-b8264a16abe1%40googlegroups.com.