On 15 May 2012 23:08, Ronan Lamy <[email protected]> wrote:
> Le mardi 15 mai 2012 à 22:52 +0200, [email protected] a écrit :
>> > A Lambda is a function, while Application is the base class for the
>> > image of an object by a function. These are completely different things,
>> > so neither should be a subclass of the other.
>> >
>> I do not understand.
>>
>> Function subclasses Application. An instance of Function is something
>> that is callable onto Expr and returns an Expr
>
> No, instances of Function aren't callable, they are already the result
> of a call. A typical instance is like 'cos(x)'.
I am very confused now:
In [2]: f = Function('f')
In [3]: f(x)
Out[3]: f(x)
Maye you mean that the Function constructor is utterly confusing by:
In [4]: type(f)
Out[4]: sympy.core.function.UndefinedFunction # And NOT Function
>>
>> An instance of Lambda is something callable onto Expr and returns an Expr.
>>
>> I do not see the difference. (Maybe I am just wrong in my previous
>> statements?)
>>
>>
>> > Note that I don't think it makes much sense for Lambda to subclass Expr:
>> > Lambdas can't be meaningfully added or multiplied together (well,
>> > technically you can, but the result doesn't behave like a Lambda at
>> > all).
>> >
>> I see your point, but I think this is just an excessive (in my
>> opinion, obviously I am no authority on the subject) and useless
>> control. If one wants the "product" of a Lambda, Point, Matrix and a
>> Symbol why stop him. Anyway, this is probably off topic.
>>
> Well, you can (and I think you will always be able to) create an object
> with Mul(<Lambda>, <Point>, <Matrix>, <Symbol>). The question is whether
> it should be supported by the interface if you try to write
> <Lambda>*<Point>*<Matrix>*<Symbol>.
>
Oh... Thanks for explaining that! It makes sooo many things be a bit
less nonsensical now.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.