2010/6/18 Ronan Lamy <ronan.l...@gmail.com>: > Le vendredi 18 juin 2010 à 02:02 +0200, Vinzent Steinberg a écrit : >> Using the local assumptions hack we could keep compatibility and avoid >> rewriting sympy. > > I don't see how. Putting everything into global_assumptions works just > as well, it's only less efficient. Changing the assumption system is a > major design change that unavoidably has major consequences all over the > code.
Using local assumptions you can emulate exactly the old behavior I think. Look at this code: def some_function(): x = Symbol('x', real=True) assert ask(x, Q.real) x = Symbol('x', real=False) assert not ask(x, Q.real) some_function() assert not ask(x, Q.real) You could replace the ask calls with 'x.is_real', that is syntactic sugar. This code would raise an exception with global assumptions but not with local assumptions. With global assumption you would have to clean the assumptions explicitly, with local scoping this is done automatically. So I think that is a way to keep backward compatibility. Of course you are right that we have to change a lot of code to use the new interface, but the old one would still work, so we could do it incrementally. Does this answer your question in a comprehensible manner? :) Vinzent -- You received this message because you are subscribed to the Google Groups "sympy-patches" group. To post to this group, send email to sympy-patc...@googlegroups.com. To unsubscribe from this group, send email to sympy-patches+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy-patches?hl=en.