Nathann Cohen wrote:
> Okay, so what do we do with this bug?

It's not a bug, it's a feature.  (Sadly, though.)


> 1) make Sage's default 'max' be 'max_symbolic' (yes/no)

In principle yes, if writing __builtin__.max wasn't that ugly and tedious.


> 2) Return "Unknown" instead of False in the __bool__ function od
> symbolic comparisons (yes/no)

Yeah, go with SQL, apparently the only programming language where the
Boolean(!) type is three-valued (the third value being UNKNOWN; in
general, there are a couple of different meanings for being neither true
nor false).

More appropriate would probably be to return None (kind of a bottom
element of all domains in Python) instead.

We could also raise NotImplementedError, which comes close to the reason
I think.


> On Saturday, May 9, 2015 at 7:11:42 PM UTC+2, Nils Bruin wrote:
> 
>     On Saturday, May 9, 2015 at 6:25:49 AM UTC-7, Volker Braun wrote:
> 
>         Arguably it should raise, though that is possibly only legal in
>         Python 3
> 
>     Where does the myth come from that comparison is not allowed to
>     raise errors in python 2?
> 
>     Python 2.7.5 (default, Nov  3 2014, 14:33:39)
>     [GCC 4.8.3 20140911 (Red Hat 4.8.3-7)] on linux2
>     Type "help", "copyright", "credits" or "license" for more information.
>     >>> complex(1,2)<complex(3,4)
>     TypeError: no ordering relation is defined for complex numbers

There's a slight difference compared to the symbolic max():

In Python,

    c = complex(a,b)
    c <= c

also raises a TypeError (instead of returning True), so the outcome
doesn't depend on the values.


-leif


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to