Message398187
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 |
|
Date |
User |
Action |
Args |
2021-07-25 16:37:03 | rhettinger | set | recipients:
+ rhettinger, glyph, Dennis Sweeney |
2021-07-25 16:37:03 | rhettinger | set | messageid: <1627231023.23.0.876054043294.issue44605@roundup.psfhosted.org> |
2021-07-25 16:37:03 | rhettinger | link | issue44605 messages |
2021-07-25 16:37:03 | rhettinger | create | |
|