On 2015-04-01 22:27, William Stein wrote:
Nils answered that it sort of was one, but the Python people realized it was a bad choice, and have moved away from it.
To be more precise: Python 2 has two independent ways of doing comparison: there is __cmp__ on the one hand and __eq__, __lt__ and so on on the other hand (the latter are grouped as __richcmp__ in Cython).
When sorting, __cmp__ is used but when the user types x < y, then __lt__ is used.
I think it is only __cmp__ which is not allowed to raise exceptions. With the other comparisons, you can do what you want.
These comparisons are all independent, there is no requirement of consistency between different comparison operators.
Good night, Jeroen. -- 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.