Alexander Boyd <a...@opengroove.org> added the comment: This is not fixed. The accepted fix doesn't take NotImplemented into account, with the result that comparing two mutually-incomparable objects whose ordering operations were generated with total_ordering causes a stack overflow instead of the expected "TypeError: unorderable types: Foo() op Bar()".
I've attached a fix for this. It properly takes NotImplemented into account. It also generates __eq__ from __ne__ and vice versa if only one of them exists. ---------- nosy: +javawizard Added file: http://bugs.python.org/file21708/sane_total_ordering.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10042> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com