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 ncoghlan, python-dev, rhettinger, serhiy.storchaka
Date 2015-01-04.05:49:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Serhiy, this is a really nice idea.  By removing the additional layer of indirection, the code is more intelligible, runs faster, and the tracebacks make more sense when the user's root comparison raises an exception.

Since there are only twelve functions involved, I don't think the function templates give us much of a payoff.  Instead, it would be better to just precompute the 12 functions rather than have 5 templates.

I've attached a patch relative to Python 3.4.  Ideally, I would like this backported to 3.4 to fix the regression in performance and intelligibility.

One further possible change is to localize the NotImplemented global variable.  This will reduce the overhead of NotImplemented checking to almost nothing and almost completely restore the performance of earlier versions.
Date User Action Args
2015-01-04 05:49:32rhettingersetrecipients: + rhettinger, ncoghlan, python-dev, serhiy.storchaka
2015-01-04 05:49:32rhettingersetmessageid: <>
2015-01-04 05:49:32rhettingerlinkissue23132 messages
2015-01-04 05:49:31rhettingercreate