Am 31.03.2014 03:35, schrieb Aaron Meurer:
Yes, unfortunately, Add does not call __add__ on its elements, and there is
currently no easy way to dispatch into Add. This is something that we'd
like to fix. One of the main reasons we haven't yet is that we're not clear
what the best way to do it is (how do you efficiently dispatch on an n-ary
function like Add?).

You set up a dispatch table with n dimensions.
If you wish to avoid multi-level lookups, merge the dimensions into one - you'll have to rebuild the dispatch table every time a new subclass with more overrides is included, but that won't happen very often.

The real issue with multiple dispatch is that you can't have it both surprise-free and module, at best there's a trade-off and no sweet spots, at worst you botch both properties (I've seen all variants of that happen).

--
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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/5339AA7B.3080104%40durchholz.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to