Message134013
| Author |
lregebro |
| Recipients |
eric.araujo, francescor, javawizard, lregebro, python-dev, rhettinger |
| Date |
2011年04月19日.07:32:08 |
| SpamBayes Score |
1.7984602e-08 |
| Marked as misclassified |
No |
| Message-id |
<1303198330.19.0.204077220192.issue10042@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|