Lennart Regebro <rege...@gmail.com> added the comment:

We *do* care about NotImplemented, that's the whole point of this bug report. I 
don't see how this is a problem in the new_total_ordering.py example. Can you 
give an example of when you get a stack overflow?

The examples in new_total_ordering are in themselves badly implemented, as they 
do check of the class with an isinstance, but if it is not the correct 
instance, they will return False or raise a TypeError. That's wrong, they 
should return NotImplemented, to give the other class a chance. But that is not 
a problem for the tests, it's only a problem if you use the tests as examples 
of how to implement a comparable class.

But in no case am I able to get a stack overflow here, which I can with the old 
total_ordering recipe.

----------

_______________________________________
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

Reply via email to