Hi, Aaron is now with me in Los Alamos and we are trying to figure out how to nicely incorporate the Constant class inside SymPy, it's currently in this branch:
http://github.com/asmeurer/sympy/tree/constant-Mul and it works, however, as you can see, it need modifications in the Add and Mul classes, and that's bad. The same goes to the Order class, which also needs special handling in Mul and Add, and that's bad too. I would like to find a solution, so that people can hook up their own classes inside sympy and it would just work, yet the core would not have to be modified. One thing that we figured out is to use a handler, essentially Basic() would have some fast handler, that would work for symbols and be fast (using dictionaries). But then Constant and Order could override that handler and do their own stuff, like O(x)+x -> O(x) and similar things, for which the default handler will fail, because O(x) != x, and thus the dictionary approach will fail. If anyone has any ideas how to approach this, it'd be awesome --- just throw your idea here, no matter how crazy it is. Ondrej --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---