Message380614
| Author | serhiy.storchaka |
|---|---|
| Recipients | ethan.furman, gvanrossum, josh.r, rhettinger, serhiy.storchaka, steven.daprano, terry.reedy, veky, xtreak |
| Date | 2020-11-09.20:06:15 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1604952375.71.0.89805610544.issue35712@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
I am sad that such code (as well as my former code in total_ordering) no longer works, but this is just a clever trick, and the code can be written in less clever but more explicit way. On other hand, the warning helps to catch common mistakes like not self.__lt__(other) self.__lt__(other) or self.__eq__(other) super().__eq__(other) and self.x == other.x Even non-beginners often make such kind of mistakes, and it is hard to catch them if you have not trained yourself specially. I suggest you to include lessons about writing complex comparison methods in your course for advanced users. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-11-09 20:06:15 | serhiy.storchaka | set | recipients: + serhiy.storchaka, gvanrossum, rhettinger, terry.reedy, steven.daprano, ethan.furman, josh.r, veky, xtreak |
| 2020-11-09 20:06:15 | serhiy.storchaka | set | messageid: <1604952375.71.0.89805610544.issue35712@roundup.psfhosted.org> |
| 2020-11-09 20:06:15 | serhiy.storchaka | link | issue35712 messages |
| 2020-11-09 20:06:15 | serhiy.storchaka | create | |