On Apr 25, 2010, at 9:26 AM, Nathan O'Treally wrote:

On 25 Apr., 17:11, Gonzalo Tornaria <torna...@math.utexas.edu> wrote:
Also, the "== doesn't fail" part seems to force this, since it would
be even more awkward to hide the coercion failure.

See my last two posts. In addition, Sage behaves different to Python
in many other cases.
(I'd say it is *necessary* to break Python's convention here, i.e.
*don't* hide it, following the Principle of Least Astonishment -- to
mathematicians, not Python programmers -- and staying or getting ;-)
mathematically sound.)

Certainly Sage doesn't blindly follow Python conventions for everything (otherwise we wouldn't have a preparser) but there should always be good reason to do things differently, at least for consistencies sake. One reason raising an exception on [in]equality testing is that it would break hetrogenious lists and dictionaries. In fact, dictionaries could be broken in a nondeterministic manner.

It may be a good idea to return special values that evaluate to True and False, but are not actually True and False in this case.

- Robert

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to