I think I'm losing track of your question here. is_foo can't use BooleanTrue because it isn't symbolic. It will never return an arbitrary boolean expression. Also, it uses three-valued logic, whereas BooleanTrue is explicitly two-valued.
Aaron Meurer On Fri, Jun 27, 2014 at 7:36 AM, Chris Smith <smi...@gmail.com> wrote: > # Yes: if greeting: > # No: if greeting == True: > # Worse: if greeting is True: > > ok. but in the case of differentiating between None or False you have to use > the literal. > > ...is_foo cane use is True but for bool it's bad... > > > On Thursday, June 26, 2014 10:47:01 AM UTC-5, Aaron Meurer wrote: >> >> Maybe >> https://github.com/sympy/sympy/blob/master/sympy/logic/boolalg.py#L81 >> can provide some insight here. >> >> Aaron Meurer >> >> On Thu, Jun 26, 2014 at 10:33 AM, Chris Smith <smi...@gmail.com> wrote: >> >>>> x.is_real is True >> > True >> >>>> var('x',positive=True) >> > x >> >>>> (x>0) is True >> > False >> >>>> x>0 >> > True >> >>>> type(_) >> > <class 'sympy.logic.boolalg.BooleanTrue'> >> > >> > >> > I understand that the above (x>0) is True is False for the same reason >> > that >> > S(1) is 1 is False, but why don't boolean expressions use BooleanTrue, >> > too? >> > Is that ust how Python works? >> > >> > -- >> > 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+un...@googlegroups.com. >> > To post to this group, send email to sy...@googlegroups.com. >> > Visit this group at http://groups.google.com/group/sympy. >> > To view this discussion on the web visit >> > >> > https://groups.google.com/d/msgid/sympy/1946215b-573f-4f0d-833a-18a1b32b504d%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 http://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/3c5ec683-9b5d-40d9-804c-ccb69f7ebded%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 http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6LqxiQDuMxLenC62ime%3DBHxJnF5%2Bx%2BeGr6tesytu-g8CQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.