Is there a good reason for this, though? If we changed the solve subalgorithms to catch NotImplementedError and make them just give [] in that case, wouldn't solve(cos(x)*x - x**2, x) give [0], more or less automatically? Doesn't the algorithm look something like
solutions = [] for factor in split_apart_multiplicatively(expr): solutions.extend(relevant_solving_algorithm(factor)) return solutions (plus all the other stuff, like getting the numerator and checking and so on)? By the way, are you willing to work on this? You know more about the architecture of solve() than anyone else. In particular, for the NotImplementedError, I am not sure just how much of the code needs to be wrapped in try, except. My solution would just be to refactor solve into _solve, and wrap that in try, except, but that's just the lazy way. We could also try to change all upstream algorithms to not raise NotImplementedError, but that would be a lot harder, and we'd be liable to miss some stuff. For dict=True, I could probably work it out, since it's mainly just a matter of changing library code that calls solve(). Do you want to work on it, or should I? Which direction do you think we should take? Should we make dict=True the default for everything, or only for systems? dict=True is already the format used for systems if no variables are given, so it's less of a compatibility break. For single equations, it would be a bigger break, but if you think it would be best to use it there too, I am in support of it. For the corner cases, like some algorithm returning a generator, or raising an exception other than NotImplementedError (issue 3686), these are bugs, which are easy enough to fix. Aaron Meurer On Mon, May 20, 2013 at 12:52 AM, Chris Smith <smi...@gmail.com> wrote: > It does, but it it hangs on part it doesn't return the solved part. It's all > or nothing. > > -- > 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?hl=en-US. > For more options, visit https://groups.google.com/groups/opt_out. > > -- 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?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.