On Apr 10, 4:18 am, Carl Witty <[EMAIL PROTECTED]> wrote: > I like the "raise an exception" behavior, because it would eliminate > questions asking why form1 and form2 below are different (from this > sage-support > threadhttp://groups.google.com/group/sage-support/browse_thread/thread/79d0...). > (I have seen this exact problem at least twice on sage-support.) What > do you think?
I guess what i suggest wouldn't solve the plot-issue. However, i think if one doesn't know whether an inequality holds, or if the inequality simply makes no sense (such as in the case of an unordered field) then bool() should neither raise an exception nor return False but return None. I think it is much simpler to have if bool(x>0) == True: bla1 elif bool(x>0)==None: bla2 else: bla3 than catching exceptions. Perhaps it would even make sense to have a new type UnknownBool. This could be returned if the inequality may be true, whereas None could be returned if the inequality simply makes no sense. I don't like at all what happens for complex numbers or finite fields! Here are some examples. sage: bool(x>0) False # i think it should be None, or better UnknownBool or so sage: assume(x>0) sage: bool(x>-1) True # fine sage: bool(x>ComplexNumber(0,0)) True # ??? The complex field is not ordered. So, the answer "True" doesn't make sense! sage: bool(x>GF(2)(0)) False # Again, ">" does not apply. So, to get "False" or "True" isn't quite correct. sage: bool(x>ComplexNumber(-1,0)) True # --"-- sage: bool(x>ComplexNumber(-1,1)) False # --"-- Yours Simon --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---