Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35712> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com