sympy/sympy — pull request #2680 by Upabjojr (2013-12-14 21:37:24+00:00)
Title: Initial work on multiple dispatch for SymPy

Added @dispatch decorator to create multiple dispatched function.

I also rewrote the tensor module to have it work with @dispatch.

Work is still in progress.

TODO list:

* [ ] create `DispatchedBasic` and `DispatchedExpr` objects, which link the operator methods to properly multiple-dispatched functions, e.g. `__add__(self, other) ==> add(self, other)`.
* [ ] finish `varargs` (to dispatch elements as `*args`).
* [ ] discuss whether to dispatch `**kwargs`` too (my idea is NO).
* [ ] inspect how @dispatch interacts with docstring generation.
* [ ] inspect how @dispatch interacts with other sympy decorators.
* [ ] find a way to dispatch methods of classes without adding prefixes.