This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Dennis Sweeney, glyph, rhettinger
Date 2021-07-25.16:37:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1627231023.23.0.876054043294.issue44605@roundup.psfhosted.org>
In-reply-to
Content
To add support for metaclasses, replacing 'self.__lt__(other)' with 'type(self).__lt__(self, other)' will work. 

The performance degradation for the common case is about 25%:

$ py -m timeit -s 'from tmp import a, b' 'a >= b'     # op_result = type(self).__lt__(self, other)
1000000 loops, best of 5: 283 nsec per loop

$ py -m timeit -s 'from tmp import a, b' 'a >= b'     # op_result = self.__lt__(other)
1000000 loops, best of 5: 227 nsec per loop
History
Date User Action Args
2021-07-25 16:37:03rhettingersetrecipients: + rhettinger, glyph, Dennis Sweeney
2021-07-25 16:37:03rhettingersetmessageid: <1627231023.23.0.876054043294.issue44605@roundup.psfhosted.org>
2021-07-25 16:37:03rhettingerlinkissue44605 messages
2021-07-25 16:37:03rhettingercreate