I think the evaluation of booleans happens in the superclass (LatticeOp), which ignores the evaluate flag. It should probably be considered a bug. A simple workaround would be to use Symbol("true") and Symbol("false") instead of S.true and S.false (and replace them with their true boolean counterparts when you wish to evaluate them).
Aaron Meurer On Tue, Mar 8, 2016 at 3:49 PM, Vincent Noel <vincent.n...@butantan.gov.br> wrote: > Hi ! > > I'm working on a project where I need to save expressions unevaluated. So > far so good, but I'm having a problem with boolean operators. > Here is an example of expression (coming from test units, thus the apparent > weirdness) : > > True && False > > which I'm writing in Sympy as : > > sympy.And(sympy.true, sympy.false, evaluate=False) > > Problem is that, contrary to other sympy operators/functions, the > evaluate=False seems to have no effect. This always evaluate the expression > Is there any other way to prevent that ? Am I doing something wrong ? > > Many thanks for what is already an awesome library :) > > Vincent > > -- > 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 https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/9dcb1f6a-2f2c-4a2e-bd46-7d6fe19c9b82%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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 https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2BuFGz8n0zmdqJB_d6yAXMs0efjZUZuZca%3DN0Q_sqhsbw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.