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 glyph
Recipients Dennis Sweeney, glyph, rhettinger
Date 2021-08-05.18:39:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1628188749.14.0.736407475296.issue44605@roundup.psfhosted.org>
In-reply-to
Content
> Do you all have preference for 1) expanding the range of use cases to cover metaclasses but incurring a performance hit for common cases, or 2) leaving it as-is and documenting that it doesn't work for metaclasses?

If we do need the slow approach for the meta-type case, (i.e.: type(self).__lt__(other)) then why not decide on implementation at decoration time? The decorator has enough information to know if this strategy is necessary and can put different special methods in place.

(But also, wouldn't 'from operator import lt ... lt(self, other)' be a bit faster, and also more general, just because it's doing specialized dispatch in C rather than an additional Python function call / method dispatch?  I have not benchmarked myself, so please ignore if you've already tested this.)
History
Date User Action Args
2021-08-05 18:39:09glyphsetrecipients: + glyph, rhettinger, Dennis Sweeney
2021-08-05 18:39:09glyphsetmessageid: <1628188749.14.0.736407475296.issue44605@roundup.psfhosted.org>
2021-08-05 18:39:09glyphlinkissue44605 messages
2021-08-05 18:39:09glyphcreate