simplify __richcmp__ implementation