Message233389
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:32 | rhettinger | set | recipients:
+ rhettinger, ncoghlan, python-dev, serhiy.storchaka |
2015-01-04 05:49:32 | rhettinger | set | messageid: <1420350572.36.0.110042886835.issue23132@psf.upfronthosting.co.za> |
2015-01-04 05:49:32 | rhettinger | link | issue23132 messages |
2015-01-04 05:49:31 | rhettinger | create | |
|