Le samedi 05 mai 2012 à 12:18 +0200, [email protected] a écrit : > Due to ascii art I am posting this also as a gist: > https://gist.github.com/2601322 > > > At the moment we have: > ====================== > > <~~~ is for metaclasses > | \ or / is for subclasses > > Basic <~~~~~~~~ WithAssumptions > blah / \ | > \ / \ | > Expr Application <~~~ FunctionClass > \ / > \ / > Function > > > But changing it to: > =================== > > Basic <~~~~~~~~ WithAssumptions > blah | | > \ | | > Expr | > | | > | | > Application <~~~ FunctionClass > | > Function > > is a two line change in functions.py and does not cause any test failures > at least for ./bin/test core and ./bin/doctest core. > > Is there any drawback in the second approach? > I consider the its simplicity and advantage. > First, recall that instances of Function represent results of a mathematical function, and not the function itself. Since Function subclasses Expr, it can only represent functions that return an instance of Expr. The idea behind Application is to allow more general functions, returning sets or booleans, for instance. OTOH, this possibility has never been used - all its subclasses also subclass Expr anyway.
So if you want to use your approach, you should remove Application entirely and merge it into Function. -- 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.
